From c8d6617b94137fc3c3f38793e9e64074bf50df7e Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 6 Jun 2012 23:52:37 -0400 Subject: v3: hub, post bundles, sisupod_make, file selection selection for tar.xz, fix --- lib/sisu/v3/hub.rb | 50 ++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 40 insertions(+), 10 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v3/hub.rb b/lib/sisu/v3/hub.rb index a2902075..d5ab7bdd 100644 --- a/lib/sisu/v3/hub.rb +++ b/lib/sisu/v3/hub.rb @@ -64,31 +64,59 @@ module SiSU class OptionLoopFiles def initialize(opt) @opt=opt + @r=Px[:lng_lst].join('|') end def loop_files_on_given_option - @opt.files.each_with_index do |fns,i| - @opt.fns=fns + @opt.files.each_with_index do |fno,i| + @opt.fns=fno + @opt.fno=fno @opt.f_pth=@opt.f_pths[i] - if fns !~/\.-sst$/ + if fno !~/\.-sst$/ @opt.pth=@opt.paths[i] @opt.lng=@opt.lngs[i] - else - @opt.pth=Dir.pwd - @opt.lng='en' end @@pwd=@opt.pth @opt.pth=@opt.f_pths[i][:pth] @opt.lng=@opt.f_pths[i][:lng] Dir.chdir(@opt.f_pth[:pth]) #watch - @env=SiSU_Env::InfoEnv.new(fns) + @env=SiSU_Env::InfoEnv.new(fno) yield end end + def loop_files_on_given_option_bundle + @files_bundle={} + @opt.files.each_with_index do |fno,i| + fn_base_bundle=fno.gsub(/(?:~(?:#{@r}))?\.ss[tm]$/,'') + unless @files_bundle[fn_base_bundle] + @files_bundle[fn_base_bundle]={ status: :todo } + end + end + @opt.files.each_with_index do |fno,i| + fn_base_bundle=fno.gsub(/(?:~(?:#{@r}))?\.ss[tm]$/,'') + unless @files_bundle[fn_base_bundle][:status] == :done + @files_bundle[fn_base_bundle][:status] = :done + @opt.fns=fno + @opt.fno=fno + @opt.f_pth=@opt.f_pths[i] + if fno !~/\.-sst$/ + @opt.pth=@opt.paths[i] + @opt.lng=@opt.lngs[i] + end + @@pwd=@opt.pth + @opt.pth=@opt.f_pths[i][:pth] + @opt.lng=@opt.f_pths[i][:lng] + Dir.chdir(@opt.f_pth[:pth]) #watch + @env=SiSU_Env::InfoEnv.new(fno) + yield + else next + end + end + end def manifest_on_files_translated r=Px[:lng_lst].join('|') number_of_files={} @opt.files.each_with_index do |fns,i| - fn=fns.gsub(/(?:\.#{r})?\.ss[tm]$/,'') + fn=fns.gsub(/(?:~(?:#{@r}))?\.ss[tm]$/,'') if number_of_files[fn].class == Array number_of_files[fn] << i else @@ -102,7 +130,7 @@ module SiSU end end if files_translated_idx.flatten.length > 1 - SiSU_Screen::Ansi.new(@opt.cmd,'Manifest re-run on (currently generated) tranlated files',"").grey_title_hi unless @opt.act[:quiet][:set] ==:on + SiSU_Screen::Ansi.new(@opt.cmd,'Manifest re-run on (currently generated) translated files',"").grey_title_hi unless @opt.act[:quiet][:set] ==:on files_translated_idx.flatten.each do |i| @opt.fns=@opt.files[i] @opt.f_pth=@opt.f_pths[i] @@ -447,7 +475,9 @@ p "#{__LINE__}:#{__FILE__}" if @opt.act[:maintenance][:set] ==:on SiSU_Doc::Source.new(@opt).read end ensure - SiSU_Doc::Source.new(@opt).sisupod_tar_xz + OptionLoopFiles.new(@opt).loop_files_on_given_option_bundle do + SiSU_Doc::Source.new(@opt).sisupod_tar_xz + end end end if @opt.act[:images][:set]==:on #% --images, -j -- cgit v1.2.3