aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3/sysenv.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2011-09-24 08:12:12 -0400
committerRalph Amissah <ralph@amissah.com>2011-09-24 08:12:12 -0400
commit0081730547d53f86744f61f772657c34e8c5149b (patch)
treee475520e4998b98a5097313da394cdc3fa6be8e6 /lib/sisu/v3/sysenv.rb
parentv3: qrcode, sisu generated manifest output, treat as such (diff)
v3: remote, src & sisupod processing, and rsync placementsisu_3.0.19sisu-3.0.19
Diffstat (limited to 'lib/sisu/v3/sysenv.rb')
-rw-r--r--lib/sisu/v3/sysenv.rb71
1 files changed, 44 insertions, 27 deletions
diff --git a/lib/sisu/v3/sysenv.rb b/lib/sisu/v3/sysenv.rb
index b5a10614..ed2d74dc 100644
--- a/lib/sisu/v3/sysenv.rb
+++ b/lib/sisu/v3/sysenv.rb
@@ -808,7 +808,8 @@ module SiSU_Env
end
msg=''
msg=" && echo 'OK: #{@input} -> #{@output}'" unless @cmd =~/q/
- puts "rsync -az#{vb} #{action} #{@input} #{@output}" if @cmd =~/[vVM]/
+ rsync_cmd="rsync -az#{vb} #{action} #{@input} #{@output}"
+ puts rsync_cmd if @cmd =~/[vVM]/
dir_change,dir_return='',''
if chdir \
&& chdir != Dir.pwd
@@ -817,7 +818,7 @@ module SiSU_Env
end
dir_change
system("
- rsync -az#{vb} #{action} #{@input} #{@output} #{msg}
+ #{rsync_cmd} #{msg}
")
dir_return
else puts "\tWARN: #{program} not found"
@@ -2952,8 +2953,8 @@ WOK
def document
self.remote_host_base.each do |remote_conn|
local_gen=@source_path
- local_gen_image="#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/image"
- local_gen_image_external="#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/image_external"
+ #local_gen_image="#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/image"
+ #local_gen_image_external="#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/image_external"
remote_gen="#{remote_conn[:name]}/#{@env.path.stub_pwd}/."
remote_rel=remote_conn[:name] + '/' + @f.output_path.stub.rcp
src_txt=@opt.fnc
@@ -2966,66 +2967,82 @@ WOK
# System_call.new("#{local_src}/#{src_txt}",remote_src,@opt.cmd).rsync
delete_extra_files='--delete' # '--delete-after'
inp=[]
- if @opt.cmd =~/h/ \
+ if (@opt.cmd =~/h/ \
+ || @opt.cmd =~/^-[mqvVM]*R[mqvVM]*$/) \
&& FileTest.file?(@f.place_file.html_scroll.dir)
inp << @f.output_path.html_seg.rel << @f.place_file.html_scroll.rel
end
- if @opt.cmd =~/w/ \
+ if (@opt.cmd =~/w/ \
+ || @opt.cmd =~/^-[mqvVM]*R[mqvVM]*$/) \
&& FileTest.file?(@f.place_file.html_concordance.dir)
inp << @f.place_file.html_concordance.rel
end
- if @opt.cmd =~/e/ \
+ if (@opt.cmd =~/e/ \
+ || @opt.cmd =~/^-R[mqvVM]*$/) \
&& FileTest.file?(@f.place_file.epub.dir)
inp << @f.place_file.epub.rel
end
- if @opt.cmd =~/o/ \
+ if (@opt.cmd =~/o/ \
+ || @opt.cmd =~/^-[mqvVM]*R[mqvVM]*$/) \
&& FileTest.file?(@f.place_file.odt.dir)
inp << @f.place_file.odt.rel
end
- if @opt.cmd =~/b/ \
+ if (@opt.cmd =~/b/ \
+ || @opt.cmd =~/^-[mqvVM]*R[mqvVM]*$/) \
&& FileTest.file?(@f.place_file.xhtml.dir)
inp << @f.place_file.xhtml.rel
end
- if @opt.cmd =~/x/ \
+ if (@opt.cmd =~/x/ \
+ || @opt.cmd =~/^-[mqvVM]*R[mqvVM]*$/) \
&& FileTest.file?(@f.place_file.xml_sax.dir)
inp << @f.place_file.xml_sax.rel
end
- if @opt.cmd =~/X/ \
+ if (@opt.cmd =~/X/ \
+ || @opt.cmd =~/^-[mqvVM]*R[mqvVM]*$/) \
&& FileTest.file?(@f.place_file.xml_dom.dir)
inp << @f.place_file.xml_dom.rel
end
- if @opt.cmd =~/[at]/ \
+ if (@opt.cmd =~/[at]/ \
+ || @opt.cmd =~/^-[mqvVM]*R[mqvVM]*$/) \
&& FileTest.file?(@f.place_file.txt.dir)
inp << @f.place_file.txt.rel
end
- if @opt.cmd =~/i/ \
+ if (@opt.cmd =~/i/ \
+ || @opt.cmd =~/^-[mqvVM]*i[mqvVM]*$/) \
&& FileTest.file?(@f.place_file.manpage.dir)
inp << @f.place_file.manpage.rel
end
- if @opt.cmd =~/I/ \
+ if (@opt.cmd =~/I/ \
+ || @opt.cmd =~/^-[mqvVM]*I[mqvVM]*$/) \
&& FileTest.file?(@f.place_file.info.dir)
inp << @f.place_file.info.rel
end
- if @opt.cmd =~/N/ \
+ if (@opt.cmd =~/N/ \
+ || @opt.cmd =~/^-[mqvVM]*R[mqvVM]*$/) \
&& FileTest.file?(@f.place_file.hash_digest.dir)
inp << @f.place_file.hash_digest.rel
end
- if @opt.cmd =~/s/ \
+ if (@opt.cmd =~/s/ \
+ || @opt.cmd =~/^-[mqvVM]*R[mqvVM]*$/) \
&& FileTest.file?(@f.place_file.src.dir)
inp << @f.place_file.src.rel
end
- if @opt.cmd =~/S/ \
+ if (@opt.cmd =~/S/ \
+ || @opt.cmd =~/^-[mqvVM]*R[mqvVM]*$/) \
&& FileTest.file?(@f.place_file.sisupod.dir)
inp << @f.place_file.sisupod.rel
end
- if @opt.cmd =~/p/
+ if (@opt.cmd =~/p/ \
+ || @opt.cmd =~/^-[mqvVM]*R[mqvVM]*$/)
inp << @f.output_path.pdf.rel + '/' + @opt.fnb + '*'
end
- if @opt.cmd =~/Q/ \
+ if (@opt.cmd =~/Q/ \
+ || @opt.cmd =~/^-[mqvVM]*R[mqvVM]*$/) \
&& FileTest.file?(@f.place_file.qrcode_md.dir)
inp << @f.place_file.qrcode_md.rel << @f.place_file.qrcode_title.rel
end
- if @opt.cmd =~/y/ \
+ if (@opt.cmd =~/y/ \
+ || @opt.cmd =~/^-[mqvVM]*R[mqvVM]*$/) \
&& FileTest.file?(@f.place_file.manifest.dir)
inp << @f.place_file.manifest.rel
end
@@ -3034,19 +3051,19 @@ WOK
else ''
end
local_css,images,images_external,images_system='','','',''
+ images_gen=images=images_skin=images_system=local_css=''
if @opt.cmd =~/[hwbxX]/ \
- and defined? @md.ec[:image] \
- and not @md.ec[:image].empty?
+ && (defined? @md.ec[:image]) \
+ && (@md.ec[:image].length > 0)
images=@f.place_file.images.rel + '/' + @md.ec[:image].join(" #{@f.output_path.images.rel}/")
- images_external="#{local_gen_image_external}/" + @md.ec[:image].join(" #{local_gen_image_external}/")
end
- images_gen=images=images_skin=images_system=local_css=''
if @opt.cmd =~/[yhwbxX]/ \
- and defined? @md.ec[:image] \
- and not @md.ec[:image].empty?
+ && (defined? @md.ec[:image]) \
+ && (@md.ec[:image].length > 0)
local_css=@f.output_path.css.rel
images_system='_sisu/image_sys'
- if @f.output_path.images.rel.length > 0
+ if @f.output_path.images.rel.length > 0 \
+ && images_from_skin.length > 0
images_skin=@f.place_file.images.rel + '/' + images_from_skin.join(" #{@f.output_path.images.rel}/")
end
end