diff options
Diffstat (limited to 'lib/sisu/v4/cgi_sqlite.rb')
-rw-r--r-- | lib/sisu/v4/cgi_sqlite.rb | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/lib/sisu/v4/cgi_sqlite.rb b/lib/sisu/v4/cgi_sqlite.rb index 93129b5c..b3b67d42 100644 --- a/lib/sisu/v4/cgi_sqlite.rb +++ b/lib/sisu/v4/cgi_sqlite.rb @@ -69,8 +69,17 @@ module SiSU_CGI_SQLite @cX=SiSU_Screen::Ansi.new(opt.cmd).cX @env=SiSU_Env::InfoEnv.new('',opt) @image_src="#{@env.url.webserv_cgi(@opt)}/_sisu/image_sys" + @name_of={} + @name_of[:output_dir_structure]=if @opt.dir_structure_by.to_s =~/(?:language|filetype|filename)/ + @opt.dir_structure_by.to_s + else 'language' + end + @name_of[:lingual]=if @opt.lingual.to_s =~/(?:mono|multi)/ + @opt.lingual.to_s + else 'multi' + end @common=SiSU_CGI_SQL::CGI_Common.new(@webserv,@opt,@image_src,@env) - @cgi_file_name="#{Db[:name_prefix_db]}by_#{opt.dir_structure_by.to_s}_sqlite.cgi" + @cgi_file_name=@env.url.cgi_sample_search_form_name(@opt) @name_of_sqlite_db_file='sisu_sqlite.db' end def sqlite @@ -126,26 +135,21 @@ module SiSU_CGI_SQLite # if necessary make the directory '/usr/lib/cgi-bin' # here we copy the postgresql search form to cgi-bin # (copy #{@cgi_file_name} to your cgi directory) - # set file permissions to 755, & - # make symbolic link to #{@cgi_link_name} + # set file permissions to 755 WOK a=case @webserv when /pwd/; '' else <<-WOK sudo cp -vi #{Dir.pwd}/#{@cgi_file_name} /usr/lib/cgi-bin/.; \\ - cd /usr/lib/cgi-bin && \\ - sudo chmod -v 755 #{@cgi_file_name}; \\ - sudo rm -vi #{@env.url.cgi_sample_search_form_name(@opt)}; \\ - sudo ln -sf #{@cgi_file_name} #{@env.url.cgi_sample_search_form_name(@opt)}; \\ - cd - + sudo chmod -v 755 /usr/lib/cgi-bin/#{@cgi_file_name} WOK end b='(to create and populate sisu sqlite database see "man sisu" and in particular the -d flag)' SiSU_Screen::Ansi.new(@opt.cmd,a,b).warn a=<<-WOK - #{@env.webserv_base_cgi(@opt)}/cgi-bin/#{@cgi_link_name} + #{@env.webserv_base_cgi(@opt)}/cgi-bin/#{@cgi_file_name} WOK SiSU_Screen::Ansi.new(@opt.cmd,a).print_blue @@ -167,6 +171,8 @@ module SiSU_CGI_SQLite @image_src='#{@image_src}' @hosturl_cgi='#{@env.url.webserv_base_cgi(@opt)}/cgi-bin' @hosturl_files='#{@env.url.webserv_files_from_db(@opt)}' + @output_dir_structure_by='#{@name_of[:output_dir_structure]}' + @lingual='#{@name_of[:lingual]}' @db_name_prefix='#{Db[:name_prefix]}' @base='#{@env.url.webserv_base_cgi(@opt)}/cgi-bin/#{@env.url.cgi_sample_search_form_name(@opt)}' #fix sqlite WOK_SQL |