From 3535397c41976bb298825c2ed2d5ded81cc0c924 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 20 Dec 2007 00:21:53 +0000 Subject: sisupod, bugfixes for rsync placement and for download and processing --- lib/sisu/v0/hub.rb | 49 ++++++++----------------------------------------- 1 file changed, 8 insertions(+), 41 deletions(-) (limited to 'lib/sisu/v0/hub.rb') diff --git a/lib/sisu/v0/hub.rb b/lib/sisu/v0/hub.rb index 418f096f..475d626a 100644 --- a/lib/sisu/v0/hub.rb +++ b/lib/sisu/v0/hub.rb @@ -62,40 +62,6 @@ module SiSU require "#{SiSU_lib}/sysenv" include SiSU_Screen @@pwd=Dir.pwd - class Remote_download - def initialize(requested_file) - @requested_file=requested_file - end - def pod - re_p_div=/http:\/\/([^\/]+)(\/\S+?)\/(sisupod(?:\.zip)?|[^\/]+?\.ssp)$/ - re_p=/(sisupod(?:\.zip)?|[^\/]+?\.ssp)$/ - if @requested_file =~ re_p_div - @site,@pth,@pod= re_p_div.match(@requested_file).captures - elsif @requested_file =~ re_p - @pod= re_p.match(@requested_file).captures - end - def site - @site - end - def path - @pth - end - def dir_stub - re_p_stub=/.+?([^\/]+)$/ - pod_stub= re_p_stub.match(path).captures.join if path - end - def name_source - @pod - end - def name - pod_download_as=if name_source=~/(?:sisupod\.(?:zip|ssp))/ - dir_stub + '.ssp' - else name_source - end - end - self - end - end class Op @@env=SiSU_Env::Info_env.new def initialize(opt,req,message) @@ -126,8 +92,9 @@ module SiSU if not @opt.files.empty? @opt.files.each do |fns| env=SiSU_Env::Info_env.new(fns) - if fns =~ /(?:sisupod(?:\.zip)?|\.ssp)$/ - pod_name=Remote_download.new(fns).pod.name + if fns =~ /sisupod(?:\.zip)?|\S+?(?:\.ss[mt]\.zip|\.ssp)$/ + require "#{SiSU_lib}/remote" #check + pod_name=SiSU_Remote::Remote_download.new(fns).pod.name tell=SiSU_Screen::Ansi.new(@opt.cmd,pod_name) tell.puts_blue unless @opt.cmd =~/q/ @opt.files.shift @@ -360,7 +327,7 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ path[:xsd]=path[:xml] + '/rnc' path[:xsd]=path[:xml] + '/rng' #path_dtd="#{@@env.path.output}/_sisu/xml/dtd" - re_p=/(sisupod(?:\.zip)?|[^\/]+?\.ssp)$/ + re_p=/(sisupod(?:\.zip)?|\S+?\.ss[mt]\.zip|[^\/]+?\.ssp)$/ unless @opt.files.join(',') =~ re_p #do not mix pods with source markup files in command line unless ( FileTest.directory?(path[:css]) \ and FileTest.directory?(path[:xsd]) ) @@ -409,8 +376,8 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ path_image='./_sisu/processing/external_document/image' path_skin='./_sisu/processing/external_document/skin/doc' @get_s,@get_p=[],[] - re_s=/((?:https?|file):\/\/\S+?\.sst)/ - re_p=/((?:https?|file):\/\/\S+?(?:\/sisupod(?:\.zip)?|\.ssp))/ + re_s=/((?:https?|file):\/\/\S+?\.sst)$/ + re_p=/((?:https?|file):\/\/\S+?(?:\/\S+?\.ss[mt]\.zip|sisupod(?:\.zip)?|\.ssp))/ @opt.files.each do |fns| if fns =~re_s @get_s << re_s.match(fns)[1] if re_s @@ -434,7 +401,7 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ retry unless @retry_count > 1 ensure end - @opt.files=@opt.files.collect {|x| x=x.gsub(/(?:https?|file):\/\/\S+\/(\S+)\.sst/,'\1.-sst') } + @opt.files=@opt.files.collect {|x| x=x.gsub(/(?:https?|file):\/\/\S+\/(\S+)\.sst$/,'\1.-sst') } end if @opt.cmd=~/m/ #% -m dal op('dal','dal') @@ -557,7 +524,7 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ @opt.files.each do |fns| if FileTest.file?(fns) @opt.fns=fns - unless @opt.fns =~ /(?:\.(?:(?:-|ssm\.)?sst|ssm|ssp|sx[sdn]\.xml|termsheet.rb)|sisupod(?:\.zip)?)$/ + unless @opt.fns =~ /(?:\.(?:(?:-|ssm\.)?sst|ssm|ssp|sx[sdn]\.xml|termsheet.rb)|\S+?\.ss[mt]\.zip|sisupod(?:\.zip)?|\S+?\.ssp)$/ if @opt.fns=~/\.kdi$/ \ and @opt.mod.inspect =~/--(?:convert(?:-from)?|from)[=-]kdi/ elsif @opt.fns=~/\.sx[sdn]\.xml$/ \ -- cgit v1.2.3