From 74c346fa583cd93f05b7701dbce2d5bb178ee5c9 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 9 Jun 2011 23:01:57 -0400 Subject: v3: cgi, sample search form reverted to '#!/usr/bin/env ruby' * appears to be a fix in libdbi-ruby1.9.1, see comments in sisu-3.0.8 changelog --- data/doc/sisu/CHANGELOG_v3 | 11 ++++++++++- lib/sisu/v3/cgi.rb | 6 +++--- lib/sisu/v3/cgi_pgsql.rb | 2 +- lib/sisu/v3/cgi_sqlite.rb | 3 +-- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v3 b/data/doc/sisu/CHANGELOG_v3 index bb9309f5..89d301a9 100644 --- a/data/doc/sisu/CHANGELOG_v3 +++ b/data/doc/sisu/CHANGELOG_v3 @@ -26,6 +26,14 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_3.0.12.orig.tar.gz * produce authors and topics lists for the documents that are available, according to availability in each language + * cgi generated sample search form + * use ruby 1.9.2 shebang/header (sisu-pgsql, sisu-sqlite) recent upload + of libdbi-ruby1.9.1 fixes bug reported as #596103 (against + libdbd-pg-ruby1.9.1), search forms (pgsql & sqlite) can now use ruby + 1.9.2, so cgi headers changed back to #!/usr/bin/env ruby [however must + use ruby >=1.9.2] (from #!/usr/bin/ruby1.8) [see sisu-3.0.8 NOTE & + "sample search form" solution, (now superseded)] + * options * restrict glob rule checks to when --glob (-G) or --find (-f) requested * carry information on document language (from filename and or directory @@ -183,7 +191,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_3.0.8.orig.tar.gz * title, src_filename and language_document_char fields mandatory (title, title_main, src_filename, language_document_char) - * NOTE: cgi sample search form caught by Ruby/DBI libdbi-ruby1.9.1 reported + * NOTE: [libdbi-ruby1.9.1 fixed in unstable 2011-06-06, & for sisu-3.0.12] + cgi sample search form caught by Ruby/DBI libdbi-ruby1.9.1 reported reported as libdbd-pg-ruby1.9.1 bug #596103, where "select_all fails". The cgi sample search scripts for postgresql and sqlite3 are almost identical, both work in ruby 1.8.7, both have the same error in ruby 1.9.2... a very diff --git a/lib/sisu/v3/cgi.rb b/lib/sisu/v3/cgi.rb index f1d628d2..bdecb6ed 100644 --- a/lib/sisu/v3/cgi.rb +++ b/lib/sisu/v3/cgi.rb @@ -64,14 +64,14 @@ module SiSU_CGI class SiSU_search def initialize(opt) @opt=opt - @webserv=@opt.files[0].to_s.strip #verify @opt.files[0].class + @webserv=@opt.files[0].to_s.strip end def search_info a=%{ For help on sisu search, type: sisu --help search - } - SiSU_Screen::Ansi.new(@opt.cmd,a).print_grey + } + SiSU_Screen::Ansi.new(@opt.cmd,a).print_grey end def read SiSU_CGI_sqlite::SiSU_search_sqlite.new(@opt,@webserv).sqlite diff --git a/lib/sisu/v3/cgi_pgsql.rb b/lib/sisu/v3/cgi_pgsql.rb index aa4a02e8..41be70d4 100644 --- a/lib/sisu/v3/cgi_pgsql.rb +++ b/lib/sisu/v3/cgi_pgsql.rb @@ -120,7 +120,7 @@ module SiSU_CGI_pgsql end def header0 <<-WOK_SQL -#!/usr/bin/ruby1.8 +#!/usr/bin/env ruby =begin #{about} * Description: generates naive cgi search form for search of sisu database (pgsql) diff --git a/lib/sisu/v3/cgi_sqlite.rb b/lib/sisu/v3/cgi_sqlite.rb index c0ecaeb5..64124cc8 100644 --- a/lib/sisu/v3/cgi_sqlite.rb +++ b/lib/sisu/v3/cgi_sqlite.rb @@ -88,7 +88,6 @@ module SiSU_CGI_sqlite f2 << %{ when /#{Db[:name_prefix]}#{x}/; ''\n} end f2 << " end\n" - #f3 f3 << %{ db_name='sisu_sqlite.db'\n} f3 << %{ db_sqlite=case cgi['db']\n} serve.each do |x| @@ -120,7 +119,7 @@ module SiSU_CGI_sqlite end def header0 <<-WOK_SQL -#!/usr/bin/ruby1.8 +#!/usr/bin/env ruby =begin #{about} * Description: generates naive cgi search form for search of sisu database (sqlite) -- cgit v1.2.3