diff options
-rw-r--r-- | data/doc/sisu/CHANGELOG_v4 | 11 | ||||
-rw-r--r-- | data/doc/sisu/CHANGELOG_v5 | 11 | ||||
-rw-r--r-- | data/sisu/v4/v/version.yml | 6 | ||||
-rw-r--r-- | data/sisu/v5/v/version.yml | 6 | ||||
-rw-r--r-- | lib/sisu/v4/cgi_pgsql.rb | 37 | ||||
-rw-r--r-- | lib/sisu/v4/sysenv.rb | 8 | ||||
-rw-r--r-- | lib/sisu/v5/cgi_pgsql.rb | 37 | ||||
-rw-r--r-- | lib/sisu/v5/sysenv.rb | 8 |
8 files changed, 68 insertions, 56 deletions
diff --git a/data/doc/sisu/CHANGELOG_v4 b/data/doc/sisu/CHANGELOG_v4 index 5a39dd6f..0dcd5a39 100644 --- a/data/doc/sisu/CHANGELOG_v4 +++ b/data/doc/sisu/CHANGELOG_v4 @@ -23,6 +23,17 @@ v2 branch is removed; it is available in sisu =< 3.3.2 %% Reverse Chronological: +%% 4.1.3.orig.tar.xz (2013-05-30:21/4) +http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_4.1.3 +http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/debian/sisu_4.1.3-1 +http://www.jus.uio.no/sisu/pkg/src/sisu_4.1.3.orig.tar.xz + sisu_4.1.3.orig.tar.xz + sisu_4.1.3-1.dsc + +* sysenv, pgsql db connect fix + +* cgi_pgsql, cgi helper script sample search form generator, detail + %% 4.1.2.orig.tar.xz (2013-05-29:21/3) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_4.1.2 http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/debian/sisu_4.1.2-1 diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5 index 7e788f54..b6b660c9 100644 --- a/data/doc/sisu/CHANGELOG_v5 +++ b/data/doc/sisu/CHANGELOG_v5 @@ -23,6 +23,17 @@ v2 branch is removed; it is available in sisu =< 3.3.2 %% Reverse Chronological: +%% 5.0.3.orig.tar.xz (2013-05-30:21/4) +http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_5.0.3 +http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/debian/sisu_5.0.3-1 +http://www.jus.uio.no/sisu/pkg/src/sisu_5.0.3.orig.tar.xz + sisu_5.0.3.orig.tar.xz + sisu_5.0.3-1.dsc + +* sysenv, pgsql db connect fix + +* cgi_pgsql, cgi helper script sample search form generator, detail + %% 5.0.2.orig.tar.xz (2013-05-29:21/3) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_5.0.2 http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/debian/sisu_5.0.2-1 diff --git a/data/sisu/v4/v/version.yml b/data/sisu/v4/v/version.yml index 6bf1fee5..e7619f1b 100644 --- a/data/sisu/v4/v/version.yml +++ b/data/sisu/v4/v/version.yml @@ -1,5 +1,5 @@ --- -:version: 4.1.2 -:date_stamp: 2013w21/3 -:date: "2013-05-29" +:version: 4.1.3 +:date_stamp: 2013w21/4 +:date: "2013-05-30" :project: SiSU diff --git a/data/sisu/v5/v/version.yml b/data/sisu/v5/v/version.yml index 87d04e76..5b6e4fee 100644 --- a/data/sisu/v5/v/version.yml +++ b/data/sisu/v5/v/version.yml @@ -1,5 +1,5 @@ --- -:version: 5.0.2 -:date_stamp: 2013w21/3 -:date: "2013-05-29" +:version: 5.0.3 +:date_stamp: 2013w21/4 +:date: "2013-05-30" :project: SiSU diff --git a/lib/sisu/v4/cgi_pgsql.rb b/lib/sisu/v4/cgi_pgsql.rb index 61c20965..0c8f42d6 100644 --- a/lib/sisu/v4/cgi_pgsql.rb +++ b/lib/sisu/v4/cgi_pgsql.rb @@ -73,11 +73,6 @@ module SiSU_CGI_PgSQL get_init=SiSU_Env::GetInit.new @rc=get_init.sisu_yaml.rc @name_of={} - if defined? @rc['webserv'] \ - and defined? @rc['webserv']['url_root'] \ - and defined? @rc['webserv']['url_root'] =~/\S+/ - @name_of[:host_url_docs]=@rc['webserv']['url_root'] - end @name_of[:output_dir_structure]=if defined? @rc['output_dir_structure_by'] \ and defined? @rc['output_dir_structure_by'] =~/(language|filetype|filename)/ @rc['output_dir_structure_by'] @@ -90,20 +85,18 @@ module SiSU_CGI_PgSQL and defined? @rc['search']['sisu']['db'] \ and @rc['search']['sisu']['db'] =~/\S+/ @name_of[:db]=@rc['search']['sisu']['db'] - #@name_of[:cgi_script]=/https?:\/\/\S+?([^\/]+?)\.cgi$/.match(@rc['search']['sisu']['action'])[1] - @name_of[:host_url_cgi]=/(https?:\/\/\S+?)\/(?:[^\/]+?)\.cgi$/.match(@rc['search']['sisu']['action'])[1] else - @name_of[:host_url_docs]=@env.url.webserv_files_from_db(@opt) @name_of[:db]=@env.path.stub_pwd #'sisu' #breaks if not present - @name_of[:host_url_cgi]=@env.url.webserv_base_cgi(@opt) false end + @name_of[:host_url_cgi]="#{@env.url.webserv_base_cgi(@opt)}/cgi-bin" + @name_of[:host_url_docs]=@env.url.webserv_files_from_db(@opt) @name_of[:cgi_script]=@env.url.cgi_sample_search_form_name(@opt) + @name_of[:user]=@db.psql.user(@opt) @cgi_file_name="#{Db[:name_prefix_db]}by_#{opt.dir_structure_by.to_s}_pgsql.cgi" @cgi_link_name=@name_of[:cgi_script] #sisu_pgsql.cgi, @image_src="#{@env.url.webserv_base_cgi(@opt)}/_sisu/image_sys" @common=SiSU_CGI_SQL::CGI_Common.new(@webserv,@opt,@image_src,@env) - @user=@db.psql.user(@opt) end def pgsql serve=[] @@ -130,14 +123,14 @@ module SiSU_CGI_PgSQL puts <<-WOK generated sample search form: #{@cX.green}#{@cgi_file_name}#{@cX.off} default database name: #{@cX.green}#{Db[:name_prefix]}#{@name_of[:db]}#{@cX.off} (#{@name_of[:db]}) - db user: #{@cX.green}#{@db.psql.user(@opt)}#{@cX.off} - to modify use: #{@cX.brown}sisu --db-pg --db-user='#{@db.psql.user(@opt)}'#{@cX.off} - cgi & db host on: #{@cX.blue}#{@env.url.webserv_base_cgi(@opt)}#{@cX.off} - to modify use: #{@cX.brown}sisu --db-pg --webserv-search='#{@env.url.webserv_base_cgi(@opt)}'#{@cX.off} - sisu output on: #{@cX.blue}#{@env.url.webserv_files_from_db(@opt)}#{@cX.off} - to modify use: #{@cX.brown}sisu --db-pg --webserv-output='#{@env.url.webserv_files_from_db(@opt)}'#{@cX.off} - cgi search form link name: #{@cX.green}#{@env.url.cgi_sample_search_form_name(@opt)}#{@cX.off} - to modify use: #{@cX.brown}sisu --db-pg --cgi-search-form-name='#{@env.url.cgi_sample_search_form_name(@opt)}'#{@cX.off} + db user: #{@cX.green}#{@name_of[:user]}#{@cX.off} + to modify use: #{@cX.brown}sisu --db-pg --db-user='#{@name_of[:user]}'#{@cX.off} + cgi & db host on: #{@cX.blue}#{@name_of[:host_url_cgi]}#{@cX.off} + to modify use: #{@cX.brown}sisu --db-pg --webserv-search='#{@name_of[:host_url_cgi]}'#{@cX.off} + sisu output on: #{@cX.blue}#{@name_of[:host_url_docs]}#{@cX.off} + to modify use: #{@cX.brown}sisu --db-pg --webserv-output='#{@name_of[:host_url_docs]}'#{@cX.off} + cgi search form link name: #{@cX.green}#{@name_of[:cgi_script]}#{@cX.off} + to modify use: #{@cX.brown}sisu --db-pg --cgi-search-form-name='#{@name_of[:cgi_script]}'#{@cX.off} #{@cX.fuschia}(settings priority: command line; sisurc.yml; else defaults)#{@cX.off} #{@cX.fuschia}BASED ON ALREADY EXISTING databases#{@cX.off} (default database name: #{@db.psql.db}) @@ -206,13 +199,13 @@ module SiSU_CGI_PgSQL require 'dbi' @stub_default='#{@name_of[:db]}' @image_src='#{@image_src}' - @hosturl_cgi='#{@env.url.webserv_base_cgi(@opt)}/cgi-bin' - @hosturl_files='#{@env.url.webserv_files_from_db(@opt)}' + @hosturl_cgi='#{@name_of[:host_url_cgi]}' + @hosturl_files='#{@name_of[:host_url_docs]}' @output_dir_structure_by='#{@name_of[:output_dir_structure]}' @port='#{@db.psql.port}' @db_name_prefix='#{Db[:name_prefix]}' - @user='#{@user}' # check user name for access to pg database: e.g. www-data or '#{@env.user}' - @base='#{@name_of[:host_url_cgi]}/cgi-bin/#{@name_of[:cgi_script]}.cgi' #fix sqlite + @user='#{@name_of[:user]}' # check user name for access to pg database: e.g. www-data or '#{@env.user}' + @base='#{@name_of[:host_url_cgi]}/#{@name_of[:cgi_script]}' WOK_SQL end def search_statement diff --git a/lib/sisu/v4/sysenv.rb b/lib/sisu/v4/sysenv.rb index 6bc97396..f95622b5 100644 --- a/lib/sisu/v4/sysenv.rb +++ b/lib/sisu/v4/sysenv.rb @@ -4067,10 +4067,12 @@ WOK self end def psql - def user(opt) - if opt.mod.inspect =~/--db-user[=-]["']?(\S+)["']+/ + def user(opt=nil) + x=if opt \ + and opt.mod.inspect =~/--db-user[=-]["']?(\S+)["']+/ m=$1 - elsif opt.mod =~/--webserv[=-]webrick/ + elsif opt \ + and opt.mod =~/--webserv[=-]webrick/ @env.user else ((defined? @rc['db']['postgresql']['user']) \ diff --git a/lib/sisu/v5/cgi_pgsql.rb b/lib/sisu/v5/cgi_pgsql.rb index 45a4aae9..9ae9d191 100644 --- a/lib/sisu/v5/cgi_pgsql.rb +++ b/lib/sisu/v5/cgi_pgsql.rb @@ -73,11 +73,6 @@ module SiSU_CGI_PgSQL get_init=SiSU_Env::GetInit.new @rc=get_init.sisu_yaml.rc @name_of={} - if defined? @rc['webserv'] \ - and defined? @rc['webserv']['url_root'] \ - and defined? @rc['webserv']['url_root'] =~/\S+/ - @name_of[:host_url_docs]=@rc['webserv']['url_root'] - end @name_of[:output_dir_structure]=if defined? @rc['output_dir_structure_by'] \ and defined? @rc['output_dir_structure_by'] =~/(language|filetype|filename)/ @rc['output_dir_structure_by'] @@ -90,20 +85,18 @@ module SiSU_CGI_PgSQL and defined? @rc['search']['sisu']['db'] \ and @rc['search']['sisu']['db'] =~/\S+/ @name_of[:db]=@rc['search']['sisu']['db'] - #@name_of[:cgi_script]=/https?:\/\/\S+?([^\/]+?)\.cgi$/.match(@rc['search']['sisu']['action'])[1] - @name_of[:host_url_cgi]=/(https?:\/\/\S+?)\/(?:[^\/]+?)\.cgi$/.match(@rc['search']['sisu']['action'])[1] else - @name_of[:host_url_docs]=@env.url.webserv_files_from_db(@opt) @name_of[:db]=@env.path.stub_pwd #'sisu' #breaks if not present - @name_of[:host_url_cgi]=@env.url.webserv_base_cgi(@opt) false end + @name_of[:host_url_cgi]="#{@env.url.webserv_base_cgi(@opt)}/cgi-bin" + @name_of[:host_url_docs]=@env.url.webserv_files_from_db(@opt) @name_of[:cgi_script]=@env.url.cgi_sample_search_form_name(@opt) + @name_of[:user]=@db.psql.user(@opt) @cgi_file_name="#{Db[:name_prefix_db]}by_#{opt.dir_structure_by.to_s}_pgsql.cgi" @cgi_link_name=@name_of[:cgi_script] #sisu_pgsql.cgi, @image_src="#{@env.url.webserv_base_cgi(@opt)}/_sisu/image_sys" @common=SiSU_CGI_SQL::CGI_Common.new(@webserv,@opt,@image_src,@env) - @user=@db.psql.user(@opt) end def pgsql serve=[] @@ -130,14 +123,14 @@ module SiSU_CGI_PgSQL puts <<-WOK generated sample search form: #{@cX.green}#{@cgi_file_name}#{@cX.off} default database name: #{@cX.green}#{Db[:name_prefix]}#{@name_of[:db]}#{@cX.off} (#{@name_of[:db]}) - db user: #{@cX.green}#{@db.psql.user(@opt)}#{@cX.off} - to modify use: #{@cX.brown}sisu --db-pg --db-user='#{@db.psql.user(@opt)}'#{@cX.off} - cgi & db host on: #{@cX.blue}#{@env.url.webserv_base_cgi(@opt)}#{@cX.off} - to modify use: #{@cX.brown}sisu --db-pg --webserv-search='#{@env.url.webserv_base_cgi(@opt)}'#{@cX.off} - sisu output on: #{@cX.blue}#{@env.url.webserv_files_from_db(@opt)}#{@cX.off} - to modify use: #{@cX.brown}sisu --db-pg --webserv-output='#{@env.url.webserv_files_from_db(@opt)}'#{@cX.off} - cgi search form link name: #{@cX.green}#{@env.url.cgi_sample_search_form_name(@opt)}#{@cX.off} - to modify use: #{@cX.brown}sisu --db-pg --cgi-search-form-name='#{@env.url.cgi_sample_search_form_name(@opt)}'#{@cX.off} + db user: #{@cX.green}#{@name_of[:user]}#{@cX.off} + to modify use: #{@cX.brown}sisu --db-pg --db-user='#{@name_of[:user]}'#{@cX.off} + cgi & db host on: #{@cX.blue}#{@name_of[:host_url_cgi]}#{@cX.off} + to modify use: #{@cX.brown}sisu --db-pg --webserv-search='#{@name_of[:host_url_cgi]}'#{@cX.off} + sisu output on: #{@cX.blue}#{@name_of[:host_url_docs]}#{@cX.off} + to modify use: #{@cX.brown}sisu --db-pg --webserv-output='#{@name_of[:host_url_docs]}'#{@cX.off} + cgi search form link name: #{@cX.green}#{@name_of[:cgi_script]}#{@cX.off} + to modify use: #{@cX.brown}sisu --db-pg --cgi-search-form-name='#{@name_of[:cgi_script]}'#{@cX.off} #{@cX.fuschia}(settings priority: command line; sisurc.yml; else defaults)#{@cX.off} #{@cX.fuschia}BASED ON ALREADY EXISTING databases#{@cX.off} (default database name: #{@db.psql.db}) @@ -206,13 +199,13 @@ module SiSU_CGI_PgSQL require 'dbi' @stub_default='#{@name_of[:db]}' @image_src='#{@image_src}' - @hosturl_cgi='#{@env.url.webserv_base_cgi(@opt)}/cgi-bin' - @hosturl_files='#{@env.url.webserv_files_from_db(@opt)}' + @hosturl_cgi='#{@name_of[:host_url_cgi]}' + @hosturl_files='#{@name_of[:host_url_docs]}' @output_dir_structure_by='#{@name_of[:output_dir_structure]}' @port='#{@db.psql.port}' @db_name_prefix='#{Db[:name_prefix]}' - @user='#{@user}' # check user name for access to pg database: e.g. www-data or '#{@env.user}' - @base='#{@name_of[:host_url_cgi]}/cgi-bin/#{@name_of[:cgi_script]}.cgi' #fix sqlite + @user='#{@name_of[:user]}' # check user name for access to pg database: e.g. www-data or '#{@env.user}' + @base='#{@name_of[:host_url_cgi]}/#{@name_of[:cgi_script]}' WOK_SQL end def search_statement diff --git a/lib/sisu/v5/sysenv.rb b/lib/sisu/v5/sysenv.rb index edaec7f8..37492716 100644 --- a/lib/sisu/v5/sysenv.rb +++ b/lib/sisu/v5/sysenv.rb @@ -4067,10 +4067,12 @@ WOK self end def psql - def user(opt) - if opt.mod.inspect =~/--db-user[=-]["']?(\S+)["']+/ + def user(opt=nil) + x=if opt \ + and opt.mod.inspect =~/--db-user[=-]["']?(\S+)["']+/ m=$1 - elsif opt.mod =~/--webserv[=-]webrick/ + elsif opt \ + and opt.mod =~/--webserv[=-]webrick/ @env.user else ((defined? @rc['db']['postgresql']['user']) \ |