aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/sisu/v4/harvest_authors.rb11
-rw-r--r--lib/sisu/v4/harvest_topics.rb4
-rw-r--r--lib/sisu/v4/manifest.rb29
-rw-r--r--lib/sisu/v4/remote.rb2
-rw-r--r--lib/sisu/v4/sysenv.rb370
5 files changed, 215 insertions, 201 deletions
diff --git a/lib/sisu/v4/harvest_authors.rb b/lib/sisu/v4/harvest_authors.rb
index 4a11b2ee..671b93ab 100644
--- a/lib/sisu/v4/harvest_authors.rb
+++ b/lib/sisu/v4/harvest_authors.rb
@@ -69,7 +69,6 @@ module SiSU_HarvestAuthors
@file_list=opt.files
end
def songsheet
- puts 'authors:'
idx_array={}
@opt.f_pths.each do |y|
lang_hash_file_array={}
@@ -198,7 +197,8 @@ module SiSU_HarvestAuthors
file="#{harvest_pth}/authors.#{lng}.html"
end
FileUtils::mkdir_p(harvest_pth) unless FileTest.directory?(harvest_pth)
- puts "file://#{file}"
+ fileinfo=(@opt.cmd =~/[vVM]/) ? ("file://#{file}") : ''
+ SiSU_Screen::Ansi.new(@opt.cmd,"harvest authors (#{@opt.files.length} files)",fileinfo).dark_grey_title_hi unless @opt.cmd =~/q/
@output[lng][:html]=File.new(file,'w')
end
end
@@ -231,7 +231,7 @@ module SiSU_HarvestAuthors
topics="topics.#{lng}.html"
elsif @env.output_dir_structure.by? == :filename
css_path=(type !~/maintenance/) \
- ? '../_sisu/css/harvest.css'
+ ? './_sisu/css/harvest.css'
: 'harvest.css'
topics="topics.#{lng}.html"
end
@@ -244,6 +244,9 @@ module SiSU_HarvestAuthors
elsif @env.output_dir_structure.by? == :filetype
harvest_pth='.'
file="#{harvest_pth}/authors.#{lng}.html"
+ elsif @env.output_dir_structure.by? == :filename
+ harvest_pth='.'
+ file="#{harvest_pth}/authors.#{lng}.html"
end
l=ln[lng][:t]
harvest_languages += %{<a href="#{file}">#{l}</a>&nbsp;&nbsp;&nbsp;}
@@ -357,7 +360,7 @@ WOK
manifest_name=x[:file]
x[:file] + '.' + lng + '.html'
elsif @env.output_dir_structure.by? == :filename
- "../#{x[:file]}/#{x[:page]}"
+ "./#{x[:file]}/#{x[:page]}"
else '' #error
end
work=[ "#{x[:date]} #{x[:title]}", %{<p class="publication">#{x[:date]} <a href="#{manifest_at}">#{x[:title]}</a>, #{x[:author][:authors_s]}</p>} ]
diff --git a/lib/sisu/v4/harvest_topics.rb b/lib/sisu/v4/harvest_topics.rb
index 0397847e..fda71e7c 100644
--- a/lib/sisu/v4/harvest_topics.rb
+++ b/lib/sisu/v4/harvest_topics.rb
@@ -71,7 +71,6 @@ module SiSU_HarvestTopics
@file_list=opt.files
end
def songsheet
- puts 'topics:'
idx_array={}
@opt.f_pths.each do |y|
lang_hash_file_array={}
@@ -473,7 +472,8 @@ module SiSU_HarvestTopics
file="#{harvest_pth}/topics.#{lng}.html"
end
FileUtils::mkdir_p(harvest_pth) unless FileTest.directory?(harvest_pth)
- puts "file://#{file}"
+ fileinfo=(@opt.cmd =~/[vVM]/) ? ("file://#{file}") : ''
+ SiSU_Screen::Ansi.new(@opt.cmd,"harvest topics(#{@opt.files.length} files)",fileinfo).dark_grey_title_hi unless @opt.cmd =~/q/
@output[lng][:html]=File.new(file,'w')
if @opt.cmd.inspect =~/[M]/
@output[lng][:html_mnt]=File.new("#{@env.path.pwd}/topics.html",'w')
diff --git a/lib/sisu/v4/manifest.rb b/lib/sisu/v4/manifest.rb
index c8103a0a..1f5724c5 100644
--- a/lib/sisu/v4/manifest.rb
+++ b/lib/sisu/v4/manifest.rb
@@ -124,6 +124,9 @@ module SiSU_Manifest
@translate=SiSU_Translate::Source.new(md,@language)
@brace_url=SiSU_Viz::Defaults.new.url_decoration
@stylesheet=SiSU_Style::CSS_HeadInfo.new(md).stylesheet
+ @fn_lng=(@f.output_dir_structure.by_language_code?) \
+ ? ''
+ : ('.' + md.opt.lng)
end
def output
manifest=@f.write_file.manifest
@@ -448,12 +451,15 @@ module SiSU_Manifest
end
end
def qrc_image
- fn=@md.fnb
- pth=(@o_str.dump_or_redirect?) \
+ fn=(@f.output_dir_structure.by_filename?) \
+ ? 'sisu_manifest'
+ : @md.fnb
+ pth=((@o_str.dump_or_redirect?) \
+ || (@f.output_dir_structure.by_filename?)) \
? '.'
: 'qrcode'
- img_md="#{pth}/#{fn}.md.png"
- img_title="#{pth}/#{fn}.title.png"
+ img_md="#{pth}/#{fn}#{@fn_lng}.md.png"
+ img_title="#{pth}/#{fn}#{@fn_lng}.title.png"
if FileTest.file?(@f.place_file.qrcode_md.dir)==true
@manifest[:html] <<<<WOK
<tr><td class="left">
@@ -823,9 +829,18 @@ WOK
<div>
WOK
end
- harvest=(FileTest.file?("#{@f.output_path.manifest.dir}/authors.html") \
- && FileTest.file?("#{@f.output_path.manifest.dir}/topics.html")) \
- ? %{<p class="small">other document manifests: [<a href="authors.html">authors</a>] [<a href="topics.html">topics</a>]</p>}
+ if @o_str.dump_or_redirect?
+ elsif @f.output_dir_structure.by_language_code? \
+ or @f.output_dir_structure.by_filetype?
+ pth_local=@f.output_path.manifest.dir
+ pth_rel='./'
+ else
+ pth_local=@f.output_path.base.dir
+ pth_rel='../'
+ end
+ harvest=(FileTest.file?("#{pth_local}/authors#{@fn_lng}.html") \
+ && FileTest.file?("#{pth_local}/topics#{@fn_lng}.html")) \
+ ? %{<p class="small">other document manifests: [<a href="#{pth_rel}authors#{@fn_lng}.html">authors</a>] [<a href="#{pth_rel}topics#{@fn_lng}.html">topics</a>]</p>}
: ''
manifest_title=%{<p class="bold">#{@translate.manifest_description}</p>#{harvest}}
@manifest[:html] <<<<WOK
diff --git a/lib/sisu/v4/remote.rb b/lib/sisu/v4/remote.rb
index 1ef40898..3906e966 100644
--- a/lib/sisu/v4/remote.rb
+++ b/lib/sisu/v4/remote.rb
@@ -90,7 +90,7 @@ module SiSU_Remote
end
def rsync_harvest
SiSU_Screen::Ansi.new(@opt.cmd,'Remote placement metadata harvest ->','rsync_harvest').dark_grey_title_hi unless @opt.cmd =~/q/
- @remote.rsync_harvest
+ @remote.rsync.site_harvest
end
def scp
SiSU_Screen::Ansi.new(@opt.cmd,'Remote placement ->',@put).dark_grey_title_hi unless @opt.cmd =~/q/
diff --git a/lib/sisu/v4/sysenv.rb b/lib/sisu/v4/sysenv.rb
index 7fc11eb6..e95a0b1e 100644
--- a/lib/sisu/v4/sysenv.rb
+++ b/lib/sisu/v4/sysenv.rb
@@ -656,8 +656,11 @@ module SiSU_Env
end
class SystemCall
@@locale_flag=false
- def initialize(input='',output='',cmd='')
- @input,@output,@cmd=input,output,cmd
+ def initialize(input='',output='',opt_or_cmd='')
+ @input,@output=input,output
+ (opt_or_cmd.is_a?(SiSU_Commandline::Options)) \
+ ? (@cmd,@opt=opt_or_cmd.cmd,opt_or_cmd)
+ : (@cmd,@opt=opt_or_cmd,nil) #cmd.is_a?(String)
@prog=SiSU_Env::InfoProgram.new
@sys=InfoSystem.instance
end
@@ -875,7 +878,10 @@ module SiSU_Env
end
cX=SiSU_Screen::Ansi.new(@cmd).cX
msg=(@cmd =~/q/) ? '' : %{ && echo " #{cX.grey}OK: #{@input} -> #{@output}#{cX.off}"}
- amp=(@cmd =~/[vVM]/) ? '' : '&'
+ amp=(@opt \
+ && @opt.files.length > 1) \
+ ? ''
+ : ((@cmd =~/[vVM]/) ? '' : '&')
rsync_cmd="rsync -az#{vb} #{action} #{@input} #{@output}"
puts rsync_cmd if @cmd =~/[vVM]/
dir_change,dir_return='',''
@@ -3258,150 +3264,181 @@ WOK
self
end
def rsync
- @f=(@opt.act[:dal][:set]==:on) \
- ? SiSU_Env::FileOp.new(@md)
- : nil
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"
- remote_gen="#{remote_conn[:name]}/#{@env.path.stub_pwd}/."
- remote_rel=remote_conn[:name] + '/' + @f.output_path.stub.rcp
- src_txt=@opt.fnc
- if (local_gen =~/\S/ \
- and local_gen !~/\/\//) \
- and (remote_gen =~/\S/ \
- and remote_gen !~/\/\//) \
- and @@flag_remote==true \
- and @opt.cmd !~/U/
-# SiSU_Env::SystemCall.new("#{local_src}/#{src_txt}",remote_src,@opt.cmd).rsync
- delete_extra_files='--delete' # '--delete-after'
- inp=[]
- if (@opt.act[:html][:set]==:on \
- || @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.act[:concordance][:set]==:on \
- || @opt.cmd =~/^-[mqvVM]*R[mqvVM]*$/) \
- && FileTest.file?(@f.place_file.html_concordance.dir)
- inp << @f.place_file.html_concordance.rel
- end
- if (@opt.act[:epub][:set]==:on \
- || @opt.cmd =~/^-R[mqvVM]*$/) \
- && FileTest.file?(@f.place_file.epub.dir)
- inp << @f.place_file.epub.rel
- end
- if (@opt.act[:odt][:set]==:on \
- || @opt.cmd =~/^-[mqvVM]*R[mqvVM]*$/) \
- && FileTest.file?(@f.place_file.odt.dir)
- inp << @f.place_file.odt.rel
- end
- if (@opt.act[:xhtml][:set]==:on \
- || @opt.cmd =~/^-[mqvVM]*R[mqvVM]*$/) \
- && FileTest.file?(@f.place_file.xhtml.dir)
- inp << @f.place_file.xhtml.rel
- end
- if (@opt.act[:xml_sax][:set]==:on \
- || @opt.cmd =~/^-[mqvVM]*R[mqvVM]*$/) \
- && FileTest.file?(@f.place_file.xml_sax.dir)
- inp << @f.place_file.xml_sax.rel
- end
- if (@opt.act[:xml_dom][:set]==:on \
- || @opt.cmd =~/^-[mqvVM]*R[mqvVM]*$/) \
- && FileTest.file?(@f.place_file.xml_dom.dir)
- inp << @f.place_file.xml_dom.rel
- end
- if (@opt.act[:txt][:set]==:on \
- || @opt.cmd =~/^-[mqvVM]*R[mqvVM]*$/) \
- && FileTest.file?(@f.place_file.txt.dir)
- inp << @f.place_file.txt.rel
- end
- if (@opt.act[:manpage][:set]==:on \
- || @opt.cmd =~/^-[mqvVM]*i[mqvVM]*$/) \
- && FileTest.file?(@f.place_file.manpage.dir)
- inp << @f.place_file.manpage.rel
- end
- if (@opt.act[:texinfo][:set]==:on \
- || @opt.cmd =~/^-[mqvVM]*I[mqvVM]*$/) \
- && FileTest.file?(@f.place_file.info.dir)
- inp << @f.place_file.info.rel
- end
- if (@opt.act[:hash_digests][:set]==:on \
- || @opt.cmd =~/^-[mqvVM]*R[mqvVM]*$/) \
- && FileTest.file?(@f.place_file.hash_digest.dir)
- inp << @f.place_file.hash_digest.rel
- end
- if (@opt.act[:share_source][:set]==:on \
- || @opt.cmd =~/^-[mqvVM]*R[mqvVM]*$/) \
- && FileTest.file?(@f.place_file.src.dir)
- inp << @f.place_file.src.rel
- end
- if (@opt.act[:sisupod][:set]==:on \
- || @opt.cmd =~/^-[mqvVM]*R[mqvVM]*$/) \
- && FileTest.file?(@f.place_file.sisupod.dir)
- inp << @f.place_file.sisupod.rel
- end
- if (@opt.act[:pdf][:set]==:on \
- || @opt.cmd =~/^-[mqvVM]*R[mqvVM]*$/)
- inp << @f.output_path.pdf.rel + '/' + @opt.fnb + '*'
- end
- if (@opt.act[:sqlite_discrete][:set]==:on \
- || @opt.cmd =~/^-[mqvVM]*R[mqvVM]*$/) \
- && FileTest.file?(@f.place_file.sqlite_discrete.dir)
- inp << @f.place_file.sqlite_discrete.rel
- end
- if (@opt.act[:qrcode][:set]==:on \
- || @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.act[:manifest][:set]==:on \
- || @opt.cmd =~/^-[mqvVM]*R[mqvVM]*$/) \
- && FileTest.file?(@f.place_file.manifest.dir)
- inp << @f.place_file.manifest.rel
- end
- local_gen=if inp.length > 0
- inp.join(' ')
- else ''
- end
- local_css,images,images_external,images_system='','','',''
- images_gen=images=images_skin=images_system=local_css=''
- if @opt.cmd =~/[hwbxX]/ \
- && (defined? @md.ec[:image]) \
- && (@md.ec[:image].length > 0)
- images=@f.place_file.images.rel + '/' + @md.ec[:image].join(" #{@f.output_path.images.rel}/")
- end
- if @opt.cmd =~/[yhwbxX]/ \
- && (defined? @md.ec[:image]) \
- && (@md.ec[:image].length > 0)
- local_css=@f.output_path.css.rel
- images_system='_sisu/image_sys'
- end
- begin
- ##create file structure without copying files?:
- ##rsync -av -f"+ */" -f"- *" @f.output_path.base.dir remote:./path/.
- #local_dirs=%{-f"+ */" -f"- *" #{@f.output_path.base.dir}/*}
- #SiSU_Env::SystemCall.new(local_dirs,remote_gen,@opt.cmd).rsync
- local=local_gen + ' ' + images + ' ' + images_skin + ' ' + images_system + ' ' + local_css
- SiSU_Env::SystemCall.new(local,remote_rel,@opt.cmd).rsync('--relative',@f.output_path.base.dir)
- rescue
- p __LINE__.to_s + ':' + __FILE__
- local_dirs=%{--include='*/' --exclude='*' #{@f.output_path.base.dir}}
- SiSU_Env::SystemCall.new(local_dirs,remote_gen,@opt.cmd).rsync
+ f=(@opt.act[:dal][:set]==:on) \
+ ? SiSU_Env::FileOp.new(@md)
+ : nil
+ if f
+ 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"
+ remote_gen="#{remote_conn[:name]}/#{@env.path.stub_pwd}/."
+ remote_rel=remote_conn[:name] + '/' + f.output_path.stub.rcp
+ src_txt=@opt.fnc
+ if (local_gen =~/\S/ \
+ and local_gen !~/\/\//) \
+ and (remote_gen =~/\S/ \
+ and remote_gen !~/\/\//) \
+ and @@flag_remote==true \
+ and @opt.cmd !~/U/
+# SiSU_Env::SystemCall.new("#{local_src}/#{src_txt}",remote_src,@opt.cmd).rsync
+ delete_extra_files='--delete' # '--delete-after'
+ inp=[]
+ if (@opt.act[:html][:set]==:on \
+ || @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.act[:concordance][:set]==:on \
+ || @opt.cmd =~/^-[mqvVM]*R[mqvVM]*$/) \
+ && FileTest.file?(f.place_file.html_concordance.dir)
+ inp << f.place_file.html_concordance.rel
+ end
+ if (@opt.act[:epub][:set]==:on \
+ || @opt.cmd =~/^-R[mqvVM]*$/) \
+ && FileTest.file?(f.place_file.epub.dir)
+ inp << f.place_file.epub.rel
+ end
+ if (@opt.act[:odt][:set]==:on \
+ || @opt.cmd =~/^-[mqvVM]*R[mqvVM]*$/) \
+ && FileTest.file?(f.place_file.odt.dir)
+ inp << f.place_file.odt.rel
+ end
+ if (@opt.act[:xhtml][:set]==:on \
+ || @opt.cmd =~/^-[mqvVM]*R[mqvVM]*$/) \
+ && FileTest.file?(f.place_file.xhtml.dir)
+ inp << f.place_file.xhtml.rel
+ end
+ if (@opt.act[:xml_sax][:set]==:on \
+ || @opt.cmd =~/^-[mqvVM]*R[mqvVM]*$/) \
+ && FileTest.file?(f.place_file.xml_sax.dir)
+ inp << f.place_file.xml_sax.rel
+ end
+ if (@opt.act[:xml_dom][:set]==:on \
+ || @opt.cmd =~/^-[mqvVM]*R[mqvVM]*$/) \
+ && FileTest.file?(f.place_file.xml_dom.dir)
+ inp << f.place_file.xml_dom.rel
+ end
+ if (@opt.act[:txt][:set]==:on \
+ || @opt.cmd =~/^-[mqvVM]*R[mqvVM]*$/) \
+ && FileTest.file?(f.place_file.txt.dir)
+ inp << f.place_file.txt.rel
+ end
+ if (@opt.act[:manpage][:set]==:on \
+ || @opt.cmd =~/^-[mqvVM]*i[mqvVM]*$/) \
+ && FileTest.file?(f.place_file.manpage.dir)
+ inp << f.place_file.manpage.rel
+ end
+ if (@opt.act[:texinfo][:set]==:on \
+ || @opt.cmd =~/^-[mqvVM]*I[mqvVM]*$/) \
+ && FileTest.file?(f.place_file.info.dir)
+ inp << f.place_file.info.rel
+ end
+ if (@opt.act[:hash_digests][:set]==:on \
+ || @opt.cmd =~/^-[mqvVM]*R[mqvVM]*$/) \
+ && FileTest.file?(f.place_file.hash_digest.dir)
+ inp << f.place_file.hash_digest.rel
+ end
+ if (@opt.act[:share_source][:set]==:on \
+ || @opt.cmd =~/^-[mqvVM]*R[mqvVM]*$/) \
+ && FileTest.file?(f.place_file.src.dir)
+ inp << f.place_file.src.rel
+ end
+ if (@opt.act[:sisupod][:set]==:on \
+ || @opt.cmd =~/^-[mqvVM]*R[mqvVM]*$/) \
+ && FileTest.file?(f.place_file.sisupod.dir)
+ inp << f.place_file.sisupod.rel
+ end
+ if (@opt.act[:pdf][:set]==:on \
+ || @opt.cmd =~/^-[mqvVM]*R[mqvVM]*$/)
+ inp <<=(@opt.dir_structure_by == :filename) \
+ ? (f.output_path.pdf.rel + '/*.pdf')
+ : (f.output_path.pdf.rel + '/' + @opt.fnb + '*.pdf')
+ end
+ if (@opt.act[:sqlite_discrete][:set]==:on \
+ || @opt.cmd =~/^-[mqvVM]*R[mqvVM]*$/) \
+ && FileTest.file?(f.place_file.sqlite_discrete.dir)
+ inp << f.place_file.sqlite_discrete.rel
+ end
+ if (@opt.act[:qrcode][:set]==:on \
+ || @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.act[:manifest][:set]==:on \
+ || @opt.cmd =~/^-[mqvVM]*R[mqvVM]*$/) \
+ && FileTest.file?(f.place_file.manifest.dir)
+ inp << f.place_file.manifest.rel
+ end
+ local_gen=if inp.length > 0
+ inp.join(' ')
+ else ''
+ end
+ local_css,images,images_external,images_system='','','',''
+ images_gen=images=images_skin=images_system=local_css=''
+ if @opt.cmd =~/[hwbxX]/ \
+ && (defined? @md.ec[:image]) \
+ && (@md.ec[:image].length > 0)
+ images=f.place_file.images.rel + '/' + @md.ec[:image].join(" #{f.output_path.images.rel}/")
+ end
+ if @opt.cmd =~/[yhwbxX]/ \
+ && (defined? @md.ec[:image]) \
+ && (@md.ec[:image].length > 0)
+ local_css=f.output_path.css.rel
+ images_system='_sisu/image_sys'
+ end
+ begin
+ ##create file structure without copying files?:
+ ##rsync -av -f"+ */" -f"- *" f.output_path.base.dir remote:./path/.
+ #local_dirs=%{-f"+ */" -f"- *" #{f.output_path.base.dir}/*}
+ #SiSU_Env::SystemCall.new(local_dirs,remote_gen,@opt.cmd).rsync
+ local=local_gen + ' ' + images + ' ' + images_skin + ' ' + images_system + ' ' + local_css
+ SiSU_Env::SystemCall.new(local,remote_rel,@opt.cmd).rsync('--relative',f.output_path.base.dir)
+ rescue
+ p __LINE__.to_s + ':' + __FILE__
+ local_dirs=%{--include='*/' --exclude='*' #{f.output_path.base.dir}}
+ SiSU_Env::SystemCall.new(local_dirs,remote_gen,@opt.cmd).rsync
+ end
+ elsif @opt.cmd =~/U/
+ puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/
+ puts "#{local_gen} -> #{remote_gen}"
+ if FileTest.file?("#{local_src}/#{src_doc}") \
+ or FileTest.file?("#{local_src}/#{src_doc}.txz")
+ puts "#{local_src}/#{src_doc}* -> #{remote_src}"
+ end
+ else
+ puts 'suspect rsync request, ignored'
+ puts "#{local_gen} -> #{remote_gen} remote flag: #{@@flag_remote}"
+ puts "permission not granted #{__FILE__} #{__LINE__}" if @opt.cmd =~/M/
end
+ end
+ end
+ end
+ def site_harvest
+ self.remote_host_base.each do |remote_conn|
+ local=@source_path_harvest
+ l_rel="#{@env.path.webserv}/#{@env.path.stub_pwd}"
+ lng='en'
+ if @env.output_dir_structure.by? == :language
+ ldest="#{lng}/manifest"
+ files="#{ldest}/authors.html #{ldest}/topics.html"
+ elsif @env.output_dir_structure.by? == :filetype
+ ldest="manifest"
+ files="#{ldest}/authors.#{lng}.html #{ldest}/topics.#{lng}.html"
+ elsif @env.output_dir_structure.by? == :filename
+ files="#{l_rel}/authors.#{lng}.html #{l_rel}/topics.#{lng}.html"
+ end
+ remote="#{remote_conn[:name]}/#{@opt.base_stub}"
+ if @opt.act[:harvest][:set] \
+ && @opt.act[:rsync][:set]
+ (@env.output_dir_structure.by? == :filename) \
+ ? (SiSU_Env::SystemCall.new(files,remote).rsync)
+ : (SiSU_Env::SystemCall.new(ldest,remote).rsync('--relative',l_rel))
elsif @opt.cmd =~/U/
puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/
- puts "#{local_gen} -> #{remote_gen}"
- if FileTest.file?("#{local_src}/#{src_doc}") \
- or FileTest.file?("#{local_src}/#{src_doc}.txz")
- puts "#{local_src}/#{src_doc}* -> #{remote_src}"
- end
- else
- puts 'suspect rsync request, ignored'
- puts "#{local_gen} -> #{remote_gen} remote flag: #{@@flag_remote}"
- puts "permission not granted #{__FILE__} #{__LINE__}" if @opt.cmd =~/M/
+ puts "rsync_harvest: #{local} -> #{remote}"
+ else puts "permission not granted #{__FILE__} #{__LINE__}" if @opt.cmd =~/M/
end
end
end
@@ -3417,16 +3454,6 @@ WOK
SiSU_Env::SystemCall.new(ldest,remote).rsync('--relative',l_rel)
end
end
- def site_harvest
- 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_conf="#{remote_conn[:name]}/_sisu"
- SiSU_Env::SystemCall.new("#{harvest}","#{remote_manifest}").rsync
- end
- end
def site_base_sync
self.remote_host_base.each do |remote_conn|
local=@source_path
@@ -3466,37 +3493,6 @@ WOK
end
end
end
- def rsync_harvest
- self.remote_host_base.each do |remote_conn|
- local=@source_path_harvest
- @env=SiSU_Env::InfoEnv.new
- harvest_pth,file='',''
- lng='en'
- if @env.output_dir_structure.by? == :language
- harvest_out_pth="#{@env.path.webserv}/#{@opt.base_stub}/#{lng}/manifest"
- harvest_pth="#{@opt.base_stub}/#{lng}/manifest"
- files="#{harvest_out_pth}/authors.html #{harvest_out_pth}/topics.html"
- elsif @env.output_dir_structure.by? == :filetype
- harvest_out_pth="#{@env.path.webserv}/#{@opt.base_stub}/manifest"
- harvest_pth="#{@opt.base_stub}/manifest"
- files="#{harvest_out_pth}/authors.#{lng}.html #{harvest_out_pth}/topics.#{lng}.html"
- elsif @env.output_dir_structure.by? == :filename
- harvest_out_pth="#{@env.path.webserv}/#{@opt.base_stub}"
- harvest_pth="#{@opt.base_stub}"
- files="#{harvest_out_pth}/authors.#{lng}.html #{harvest_out_pth}/topics.#{lng}.html"
- end
- remote="#{remote_conn[:name]}/#{harvest_pth}/."
- if @opt.act[:harvest][:set] \
- && @opt.act[:rsync][:set]
- delete_extra_files='--delete' # '--delete-after'
- SiSU_Env::SystemCall.new(files,remote).rsync(delete_extra_files)
- elsif @opt.cmd =~/U/
- puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/
- puts "rsync_sitemaps: #{local} -> #{remote}"
- else puts "permission not granted #{__FILE__} #{__LINE__}" if @opt.cmd =~/M/
- end
- end
- end
end
class InfoVersion <InfoEnv
include Singleton
@@ -4222,7 +4218,7 @@ WOK
@@filename_html_scroll=File.new(p_fn,'w+')
end
def html_seg_index
- pth=((by_filename?) \
+ pth=((output_dir_structure.by_filename?) \
|| (output_dir_structure.dump?)) \
? "#{output_path.html.dir}"
: "#{output_path.html.dir}/#{@md.fnb}"
@@ -4232,7 +4228,7 @@ WOK
@@filename_html_index=File.new(p_fn,'w+')
end
def html_segtoc
- pth=((by_filename?) \
+ pth=((output_dir_structure.by_filename?) \
|| (output_dir_structure.dump?) \
|| (output_dir_structure.redirect?)) \
? "#{output_path.html.dir}"
@@ -5432,7 +5428,7 @@ WOK
elsif output_dir_structure.by_language_code?
'../../_sisu/image'
elsif output_dir_structure.by_filetype?
- '../../_sisu/image'
+ '../_sisu/image'
else
'../_sisu/image'
end