From d41a95421c18b10bb7e100ccd1d4f3e56743b032 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 19 Oct 2007 02:25:55 +0100 Subject: mostly adjustment to image paths (for local and remote operations) --- lib/sisu/v0/cgi_pgsql.rb | 4 ++-- lib/sisu/v0/cgi_sqlite.rb | 4 ++-- lib/sisu/v0/conf.rb | 12 ++++++++++++ lib/sisu/v0/defaults.rb | 2 +- lib/sisu/v0/sysenv.rb | 18 ++++++++++-------- 5 files changed, 27 insertions(+), 13 deletions(-) (limited to 'lib/sisu') diff --git a/lib/sisu/v0/cgi_pgsql.rb b/lib/sisu/v0/cgi_pgsql.rb index 796c49c8..b5012fdd 100644 --- a/lib/sisu/v0/cgi_pgsql.rb +++ b/lib/sisu/v0/cgi_pgsql.rb @@ -63,7 +63,7 @@ module SiSU_CGI_pgsql @opt,@webserv=opt,webserv @env=SiSU_Env::Info_env.new('',opt) @sys=SiSU_Env::System_call.new - @image_src="#{@env.url.webserv_cgi}/_sisu/image" + @image_src="#{@env.url.webserv_cgi}/_sisu/image_sys" @common=SiSU_CGI_sql::SiSU_CGI_common.new(@webserv,@opt.cmd,@image_src,@env) @db=SiSU_Env::Info_db.new #p @db.port_psql @@ -130,7 +130,7 @@ module SiSU_CGI_pgsql require 'fcgi' require 'dbi' @version='sisu_pgsql' - @image_src="#{@env.url.webserv_cgi}/_sisu/image" + @image_src="#{@env.url.webserv_cgi}/_sisu/image_sys" @hosturl_db="#{@env.url.webserv_base_cgi}" @hosturl_files="#{@env.url.webserv_files_from_db}" @port="#{@db.port_psql}" diff --git a/lib/sisu/v0/cgi_sqlite.rb b/lib/sisu/v0/cgi_sqlite.rb index 27c20163..ef62cd35 100644 --- a/lib/sisu/v0/cgi_sqlite.rb +++ b/lib/sisu/v0/cgi_sqlite.rb @@ -62,7 +62,7 @@ module SiSU_CGI_sqlite def initialize(opt,webserv) @opt,@webserv=opt,webserv @env=SiSU_Env::Info_env.new('',opt) - @image_src="#{@env.url.webserv_cgi}/_sisu/image" + @image_src="#{@env.url.webserv_cgi}/_sisu/image_sys" @common=SiSU_CGI_sql::SiSU_CGI_common.new(@webserv,@opt.cmd,@image_src,@env) end def sqlite @@ -128,7 +128,7 @@ module SiSU_CGI_sqlite require 'fcgi' require 'dbi' @version='sisu_sqlite' - @image_src="#{@env.url.webserv_cgi}/_sisu/image" + @image_src="#{@env.url.webserv_cgi}/_sisu/image_sys" @hosturl_db="#{@env.url.webserv_base_cgi}" @hosturl_files="#{@env.url.webserv_files_from_db}" WOK_SQL diff --git a/lib/sisu/v0/conf.rb b/lib/sisu/v0/conf.rb index 92632e79..eb054906 100644 --- a/lib/sisu/v0/conf.rb +++ b/lib/sisu/v0/conf.rb @@ -62,6 +62,8 @@ module SiSU_Initialize include SiSU_relaxng require "#{SiSU_lib}/css" include SiSU_Style + #require "#{SiSU_lib}/remote" + #include SiSU_Remote class Source def initialize(opt) @opt=opt @@ -73,6 +75,9 @@ module SiSU_Initialize SiSU_Config.new(@opt).cp_local_images SiSU_Config.new(@opt).cp_external_images SiSU_Config.new(@opt).cp_webserver_images #if @opt.mod.inspect =~/--init(?:ialize)?=site/ + #if @opt.cmd =~/R/ + # SiSU_Config.new(@opt).cp_remote_dirs + #end end end class SiSU_Config #config files such as css are not updated if they already exist unless forced using the --init=site modifier @@ -115,6 +120,13 @@ module SiSU_Initialize SiSU_Env::Create_site.new(@opt.cmd).cp_webserver_images SiSU_Env::Create_system_link.new.images end + #def cp_remote_dirs + # if @opt.cmd =~/R/ + # tell=SiSU_Screen::Ansi.new(@opt.cmd,'invert','Copy webserver/output file images to remote server','') + # tell.colorize unless @opt.cmd =~/q/ + # SiSU_Remote::Put.new(@opt).rsync_base + # end + #end def css tell=SiSU_Screen::Ansi.new(@opt.cmd,'invert','Configuring CSSs','') tell.colorize unless @opt.cmd =~/q/ diff --git a/lib/sisu/v0/defaults.rb b/lib/sisu/v0/defaults.rb index e75ba2e3..5701e571 100644 --- a/lib/sisu/v0/defaults.rb +++ b/lib/sisu/v0/defaults.rb @@ -200,7 +200,7 @@ module SiSU_Viz 'www.jus.uio.no/sisu' end def url_path_image_base #used for html image display - '../_sisu/image_local' + '../_sisu/image' end def url_path_image #used for html image display '../_sisu/image' diff --git a/lib/sisu/v0/sysenv.rb b/lib/sisu/v0/sysenv.rb index 3f92e9b7..5d7dc7d8 100644 --- a/lib/sisu/v0/sysenv.rb +++ b/lib/sisu/v0/sysenv.rb @@ -2378,14 +2378,14 @@ WOK and @@flag_remote==true \ and @opt.cmd !~/U/ puts "begin scp_base_all: #{local} -> #{remote}" + System_call.new("#{local}/_sisu/image_sys/",remote).scp System_call.new("#{local}/_sisu/image/",remote).scp - System_call.new("#{local}/_sisu/image_local/",remote).scp System_call.new("#{local}/#{@env.path.style}/",remote).scp elsif @opt.cmd =~/U/ puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/ puts "scp_base_all: #{local} -> #{remote}" + puts "#{local}/_sisu/image_sys/ -> #{remote}" puts "#{local}/_sisu/image/ -> #{remote}" - puts "#{local}/_sisu/image_local/ -> #{remote}" puts "#{local}/#{@env.path.style}/ -> #{remote}" else puts "permission not granted #{__FILE__} #{__LINE__}" if @opt.cmd =~/M/ end @@ -2394,21 +2394,23 @@ WOK def rsync_base #base site ldest="#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu" image_sys="#{@env.path.webserv}/_sisu/image_sys" + images="#{@env.path.webserv}/_sisu/image" self.remote_host_base.each do |remote_conn| remote="#{remote_conn[:name]}/#{@env.path.stub_pwd}/." - remote_sys="#{remote_conn[:name]}/_sisu" + remote_conf="#{remote_conn[:name]}/_sisu" if defined? @rc['permission_set']['remote_base_site'] \ and @rc['permission_set']['remote_base_site'] \ and @@flag_remote==true \ and @opt.cmd !~/U/ #puts "begin rsync_base: #{local} -> #{remote}" - System_call.new("#{image_sys}","#{remote_sys}").rsync + System_call.new("#{image_sys}","#{remote_conf}").rsync + System_call.new("#{images}","#{remote_conf}").rsync System_call.new("#{ldest}","#{remote}").rsync elsif @opt.cmd =~/U/ puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/ puts "rsync_base: #{local} -> #{remote}" - puts "#{local}/_sisu/image/ -> #{remote}" - puts "#{local}/_sisu/image_local/ -> #{remote}" + puts "#{local}/_sisu/image -> #{remote}" + puts "#{local}/_sisu/image_sys/ -> #{remote}" puts "#{local}/#{@env.path.style}/ -> #{remote}" else puts "permission not granted #{__FILE__} #{__LINE__}" if @opt.cmd =~/M/ end @@ -2423,14 +2425,14 @@ WOK and @@flag_remote==true \ and @opt.cmd !~/U/ puts "begin rsync_base_sync: #{local} -> #{remote}" + System_call.new("#{local}/_sisu/image_sys/",remote).rsync('--delete-after') System_call.new("#{local}/_sisu/image/",remote).rsync('--delete-after') - System_call.new("#{local}/_sisu/image_local/",remote).rsync('--delete-after') System_call.new("#{local}/#{@env.path.style}/",remote).rsync('--delete-after') elsif @opt.cmd =~/U/ puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/ puts "rsync_base_sync: #{local} -> #{remote}" + puts "#{local}/_sisu/image_sys/ -> #{remote}" puts "#{local}/_sisu/image/ -> #{remote}" - puts "#{local}/_sisu/image_local/ -> #{remote}" puts "#{local}/#{@env.path.style}/ -> #{remote}" else puts "permission not granted #{__FILE__} #{__LINE__}" if @opt.cmd =~/M/ end -- cgit v1.2.3