diff options
author | Ralph Amissah <ralph@amissah.com> | 2013-04-08 20:06:11 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2013-04-08 20:06:11 -0400 |
commit | 64e5514f4b05ac5f54c564e1fb4ba33b64a7e3bb (patch) | |
tree | 70292ae31c0fa54d024a31e9210ef4cef2b7e7ad | |
parent | debian/changelog (4.0.18-1) (diff) | |
parent | v4: version & changelog, dates touched (diff) |
Merge tag 'sisu_4.0.19' into debian/sid
SiSU 4.0.19
-rw-r--r-- | data/doc/sisu/CHANGELOG_v3 | 2 | ||||
-rw-r--r-- | data/doc/sisu/CHANGELOG_v4 | 17 | ||||
l--------- | data/doc/sisu/markup-samples/v4/sisu_manual/_sisu/image/cp | 1 | ||||
-rw-r--r-- | data/sisu/v4/v/version.yml | 6 | ||||
-rw-r--r-- | lib/sisu/v4/hub.rb | 26 | ||||
-rw-r--r-- | lib/sisu/v4/options.rb | 11 | ||||
-rw-r--r-- | lib/sisu/v4/param.rb | 20 | ||||
-rw-r--r-- | lib/sisu/v4/particulars.rb | 10 | ||||
-rw-r--r-- | lib/sisu/v4/sysenv.rb | 104 | ||||
-rw-r--r-- | lib/sisu/v4/zap.rb | 23 |
10 files changed, 126 insertions, 94 deletions
diff --git a/data/doc/sisu/CHANGELOG_v3 b/data/doc/sisu/CHANGELOG_v3 index 614167ca..a02f6cb2 100644 --- a/data/doc/sisu/CHANGELOG_v3 +++ b/data/doc/sisu/CHANGELOG_v3 @@ -16,6 +16,8 @@ v1 branch is removed; it is available in sisu =< 2.7 %% Legacy Branch, Reference + Version 3 to be closed on opening of version 4.1.* branch + Version 3 introduced output directory structures nad filenames more compatible with mobile devices and other non-web use and more internationalisation possibilities. diff --git a/data/doc/sisu/CHANGELOG_v4 b/data/doc/sisu/CHANGELOG_v4 index 29a44eff..6a528e28 100644 --- a/data/doc/sisu/CHANGELOG_v4 +++ b/data/doc/sisu/CHANGELOG_v4 @@ -21,6 +21,19 @@ v2 branch is removed; it is available in sisu =< 3.3.2 %% Reverse Chronological: +%% 4.0.19.orig.tar.xz (2013-04-08:14/1) +http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_4.0.19 +http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/debian/sisu_4.0.19-1 +http://www.jus.uio.no/sisu/pkg/src/sisu_4.0.19.orig.tar.xz + sisu_4.0.19.orig.tar.xz + sisu_4.0.19-1.dsc + +* v4: sysenv, yamlrc, minor + +* v4: options, exclude manifest links if no manifest (--no-manifest) selected + +* v4: zap, delete output files, based on given (existing) source file name + %% 4.0.18.orig.tar.xz (2013-03-29:12/5) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_4.0.18 http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/debian/sisu_4.0.18-1 @@ -30,7 +43,9 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_4.0.18.orig.tar.xz * v4: dal, screen_text_color, distinguish doc abstraction as start of processing -* v4: dbi, import composite files (.ssm) correctly +* v4: dal, reading/processing composite markup files (.ssm) + * dbi, import composite files correctly + * manifest, mini-table of contents, for multi-lingual composite files * v4: cgi, auto-generated sample search form * for various sisu output directory structures diff --git a/data/doc/sisu/markup-samples/v4/sisu_manual/_sisu/image/cp b/data/doc/sisu/markup-samples/v4/sisu_manual/_sisu/image/cp deleted file mode 120000 index 68e480cc..00000000 --- a/data/doc/sisu/markup-samples/v4/sisu_manual/_sisu/image/cp +++ /dev/null @@ -1 +0,0 @@ -cp
\ No newline at end of file diff --git a/data/sisu/v4/v/version.yml b/data/sisu/v4/v/version.yml index c92a3220..b3493aa7 100644 --- a/data/sisu/v4/v/version.yml +++ b/data/sisu/v4/v/version.yml @@ -1,5 +1,5 @@ --- -:version: 4.0.18 -:date_stamp: 2013w12/5 -:date: "2013-03-29" +:version: 4.0.19 +:date_stamp: 2013w14/1 +:date: "2013-04-08" :project: SiSU diff --git a/lib/sisu/v4/hub.rb b/lib/sisu/v4/hub.rb index 70a9fc9a..0691ff37 100644 --- a/lib/sisu/v4/hub.rb +++ b/lib/sisu/v4/hub.rb @@ -259,6 +259,9 @@ module SiSU @tell=lambda { SiSU_Screen::Ansi.new(@opt.cmd,@msg,"#{@msgs.inspect if @msgs}") } end def do_loops + if @opt.act[:zap][:set]==:on #% --zap, -Z + do_loop_files_on_given_option_pre + end do_each_file_loop_options do_loop_files_on_given_option_post end @@ -367,16 +370,15 @@ module SiSU end end end - def loop_files_on_given_option_pre_do - if @opt.act[:sisupod][:set]==:on #% --sisupod, -S make sisupod - require_relative 'sisupod_make' # -S sisupod_make.rb - begin + def do_loop_files_on_given_option_pre + begin + if @opt.act[:zap][:set]==:on #% --zap, -Z OptionLoopFiles.new(@opt).loop_files_on_given_option do - SiSU_Doc::Source.new(@opt).read + require_relative 'zap' + SiSU_Zap::Source.new(@opt).read # -Z zap.rb end - ensure - SiSU_Doc::Source.new(@opt).sisupod_tar_xz end + ensure end end def do_loop_files_on_given_option_post @@ -479,12 +481,6 @@ module SiSU SiSU_DBI::SQL.new(@opt).connect # -D -d dbi.rb end end - if @opt.act[:zap][:set]==:on #% --zap, -Z - # OptionLoopFiles.new(@opt).loop_files_on_given_option do - # require_relative 'zap' - # SiSU_Zap::Source.new(@opt).read # -Z zap.rb - # end - end if @opt.act[:manifest][:set]==:on #% --manifest, -y require_relative 'manifest' OptionLoopFiles.new(@opt).manifest_on_files_translated do @@ -580,10 +576,6 @@ module SiSU if @opt.act[:webrick][:set]==:on #% --webrick, -W webrick SiSU::Operations.new(@opt).webrick end - if @opt.act[:zap][:set]==:on #% --zap -Z wipe previous output clean DUPLICATE - #require_relative 'zap' - #SiSU_Zap::Source.new(@opt).read # -Z zap.rb - end if @opt.act[:dal][:set]==:on @retry_count= -1 begin diff --git a/lib/sisu/v4/options.rb b/lib/sisu/v4/options.rb index 0608df4e..20499964 100644 --- a/lib/sisu/v4/options.rb +++ b/lib/sisu/v4/options.rb @@ -718,6 +718,9 @@ module SiSU_Commandline end act[:links_to_manifest]=if mod.inspect =~/"--inc-links-to-manifest"|"--inc-manifest-links"/ { bool: true, set: :on } + elsif mod.inspect =~/"--(?:exc|no)-manifest"/ \ + || act[:switch][:off].inspect =~/"manifest"/ #place lower + { bool: false, set: :off } elsif mod.inspect =~/"--(?:exc|no)-links-to-manifest"|"--(?:exc|no)-manifest-links"/ \ || act[:switch][:off].inspect =~/"links_to_manifest"|"manifest_links"|"--(?:exc|no)-manifest"/ \ || mod.inspect =~/"--(?:redirect|dump)/ @@ -942,10 +945,6 @@ module SiSU_Commandline || mod.inspect =~/"--git"/) \ ? { bool: true, set: :on } : { bool: false, set: :na } - act[:zap]=(cmd =~/Z/ \ - || mod.inspect =~/"--zap"|"--delete"/) \ - ? { bool: true, set: :on } - : { bool: false, set: :na } act[:hash_digests]=(cmd =~/N/ \ || mod.inspect =~/"--hash-digests"/) \ ? { bool: true, set: :on } @@ -974,8 +973,8 @@ module SiSU_Commandline || mod.inspect =~/"--rsync"/) \ ? { bool: true, set: :on } : { bool: false, set: :na } - act[:delete_output]=(cmd =~/z/ \ - || mod.inspect =~/"--delete"|"--zap"/) \ + act[:zap]=(cmd =~/Z/ \ + || mod.inspect =~/"--zap"|"--delete"/) \ ? { bool: true, set: :on } : { bool: false, set: :na } act[:urls_all]=(cmd =~/U/ \ diff --git a/lib/sisu/v4/param.rb b/lib/sisu/v4/param.rb index 035697c9..b8e582eb 100644 --- a/lib/sisu/v4/param.rb +++ b/lib/sisu/v4/param.rb @@ -1320,7 +1320,8 @@ module SiSU_Param : papersize_array_rc fn=@opt.fno #decide what to do a filesize on .ssm tells very little about actual document size @filesize=(File.size(fn)).to_s - if @sys.openssl !=false + if @sys.openssl !=false \ + and FileTest.file?(@env.source_file_with_path) @dgst=[] if @env.digest.type =~/sha256/ dgst=@sys.sha256(@env.source_file_with_path) @@ -1331,6 +1332,8 @@ module SiSU_Param @dgst=dgst[1].length==32 ? dgst : nil puts 'check document (md5) digest' if not @dgst end + elsif not FileTest.file?(@env.source_file_with_path) + #puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:fuchsia) end @publisher ||= "#{@@publisher} (this copy)" fn_set_lang=SiSU_Env::StandardiseLanguage.new(@opt.lng).language @@ -1345,23 +1348,8 @@ module SiSU_Param @language[:name]=fn_set_lang[:n] end @fnl=@env.i18n.lang_filename(fn_set_lang[:c]) -#fix -# @flv.each do |l| -# lang=SiSU_Env::StandardiseLanguage.new.file_to_language(l) -# c={ a: '', b: '', c: '' } -# if @fnl[:pre] =~/\S/ then c[:a]="#{lang[:c]}." -# elsif @fnl[:mid] =~/\S/ then c[:b]=".#{lang[:c]}" -# elsif @fnl[:post] =~/\S/ then c[:c]=".#{lang[:c]}" -# end -# @lang << [lang[:n],"#{c[:a]}sisu_manifest#{c[:b]}.html#{c[:c]}"] -# end if @flv @lang=@lang.uniq @fn=SiSU_Env::EnvCall.new(@fns).lang(fn_set_lang[:c]) - #if @identifier.is_a?(Array) - # @identifier[:sisupod]=sisupod_hash_value - #else @identifier={ sisupod: sisupod_hash_value } - #end - #"#{@env.url.root}/#{@fnb}/#{@fn[:toc]}" #DC note constructed dc identifier if @en[:note] > 0 \ and @en[:sum] > 0 if @en[:sum] > 0 diff --git a/lib/sisu/v4/particulars.rb b/lib/sisu/v4/particulars.rb index c893be0c..b7ea2f3a 100644 --- a/lib/sisu/v4/particulars.rb +++ b/lib/sisu/v4/particulars.rb @@ -207,8 +207,14 @@ module SiSU_Particulars @nametags_map=SiSU_DAL::Source.new(opt).get_map_nametags self rescue - SiSU_Errors::InfoError.new($!,$@,opt.cmd,opt.fnl).error do - __LINE__.to_s + ':' + __FILE__ + if @md + SiSU_Errors::InfoError.new($!,$@,@md.opt.cmd,@md.opt.fnl).error do + __LINE__.to_s + ':' + __FILE__ + end + else + SiSU_Errors::InfoError.new($!,$@,opt.cmd,opt.fnl).error do + __LINE__.to_s + ':' + __FILE__ + end end end end diff --git a/lib/sisu/v4/sysenv.rb b/lib/sisu/v4/sysenv.rb index d77672a6..400d53b0 100644 --- a/lib/sisu/v4/sysenv.rb +++ b/lib/sisu/v4/sysenv.rb @@ -336,18 +336,20 @@ module SiSU_Env break else f=S_CONF[:rc_yml] - if FileTest.exist?("#{v}/#{f}") + p_f="#{v}/#{f}" + if FileTest.exist?(p_f) require 'yaml' @@sisurc_path=v - @@rc=YAML::load(File::open("#{@@sisurc_path}/#{f}")) + @@rc=YAML::load(File::open(p_f)) break end unless @@rc f='sisurc.yaml' - if FileTest.exist?("#{v}/#{f}") + p_f="#{v}/#{f}" + if FileTest.exist?(p_f) require 'yaml' @@sisurc_path=v - @@rc=YAML::load(File::open("#{@@sisurc_path}/#{f}")) + @@rc=YAML::load(File::open(p_f)) break end end @@ -3036,45 +3038,71 @@ WOK include FileUtils::Verbose def initialize(opt) @opt=opt - z=SiSU_Env::FileMap.new(@opt) - @zap=z.local_sisu_source - if @opt.cmd =~ /[hH]/ - @zap=Dir.glob(@zap).join(' ') - @zap=if @opt.cmd !~ /w/ - @zap.gsub(/#{@source_path}\/concordance.html/,'') - else @zap + z=SiSU_Env::FileMap.new(opt) + zap=z.local_sisu_source + if opt.cmd =~ /h/i + zap=Dir.glob(zap).join(' ') + @zap=if opt.cmd !~ /w/ + zap.gsub(/#{@source_path}\/concordance.html/,'') + else zap end end @env=SiSU_Env::InfoEnv.new end def zap - def main_output - (@zap !~/\/\//) \ - ? (FileUtils::rm_rf(@zap) if FileTest.directory?(@zap)) - : (puts 'suspect zap request, ignored') - end - def site_map - if @opt.fnb \ - and not @opt.fnb.empty? - sm="#{@env.path.output}/sitemaps/sitemap_#{@opt.fnb}.xml" - FileUtils::rm(sm) if FileTest.file?(sm) - end - end - def epub - if @opt.fnb \ - and not @opt.fnb.empty? - sm="#{@env.path.output}/epub/#{@opt.fnb}.epub" - FileUtils::rm(sm) if FileTest.file?(sm) - end - end - def src # consider - if @opt.fnb \ - and not @opt.fnb.empty? - sm="#{@env.path.output}/src/pod/#{@opt.fns}.txz" - FileUtils::rm(sm) if FileTest.file?(sm) - sm="#{@env.path.output}/src/#{@opt.fns}" - FileUtils::rm(sm) if FileTest.file?(sm) - end + def deletion(fn) + if FileTest.file?(fn)==true + File.delete(fn) + tell=SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns, 'remove: ' + fn) + tell.warn unless @opt.cmd =~/q/ + end + end + def remove_output + if @opt.act[:maintenance][:set] == :on + m=InfoFile.new(@opt.fnc) + tell=SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns, 'remove maintenance files from: ' + @env.processing_path.dal) + tell.warn unless @opt.cmd =~/q/ + deletion(m.marshal.dal_content) + deletion(m.marshal.dal_idx_sst_rel_html_seg) + deletion(m.dal_idx_sst_rel) + deletion(m.dal_idx_html) + deletion(m.dal_idx_xhtml) + deletion(m.dal_metadata) + deletion(m.dal_map_nametags) + deletion(m.dal_map_ocn_htmlseg) + deletion(m.html_tune) + end + md=SiSU_Param::Parameters.new(@opt).get + f=SiSU_Env::FileOp.new(md) + deletion(f.place_file.html_segtoc.dir) + deletion(f.place_file.html_scroll.dir) + deletion(f.place_file.html_book_index.dir) + deletion(f.place_file.html_concordance.dir) + deletion(f.place_file.epub.dir) + deletion("#{f.output_path.pdf.dir}/#{f.base_filename.pdf_p_letter}") + deletion("#{f.output_path.pdf.dir}/#{f.base_filename.pdf_l_letter}") + deletion("#{f.output_path.pdf.dir}/#{f.base_filename.pdf_p_a4}") + deletion("#{f.output_path.pdf.dir}/#{f.base_filename.pdf_l_a4}") + deletion("#{f.output_path.pdf.dir}/#{f.base_filename.pdf_p_a5}") + deletion("#{f.output_path.pdf.dir}/#{f.base_filename.pdf_l_a5}") + deletion("#{f.output_path.pdf.dir}/#{f.base_filename.pdf_p_b5}") + deletion("#{f.output_path.pdf.dir}/#{f.base_filename.pdf_l_b5}") + deletion("#{f.output_path.pdf.dir}/#{f.base_filename.pdf_p_legal}") + deletion("#{f.output_path.pdf.dir}/#{f.base_filename.pdf_p_legal}") + deletion(f.place_file.odt.dir) + deletion(f.place_file.xhtml.dir) + deletion(f.place_file.xml_sax.dir) + deletion(f.place_file.xml_dom.dir) + deletion(f.place_file.info.dir) + deletion(f.place_file.manpage.dir) + deletion(f.place_file.sqlite_discrete.dir) + deletion(f.place_file.txt.dir) + deletion(f.place_file.hash_digest.dir) + deletion(f.place_file.manifest.dir) + deletion(f.place_file.qrcode_md.dir) + deletion(f.place_file.qrcode_title.dir) + deletion(f.place_file.src.dir) + deletion(f.place_file.sisupod.dir) end self end diff --git a/lib/sisu/v4/zap.rb b/lib/sisu/v4/zap.rb index fbda244f..42f41fb7 100644 --- a/lib/sisu/v4/zap.rb +++ b/lib/sisu/v4/zap.rb @@ -66,20 +66,23 @@ module SiSU_Zap class Source def initialize(opt) @opt=opt - @env=SiSU_Env::InfoEnv.new(@opt.fns) - @zap_path="#{@env.path.output}/#{@env.fnb}" - @zap=SiSU_Env::CleanOutput.new(@opt) + @env=SiSU_Env::InfoEnv.new(opt.fns) end def read + zap_path="#{@env.path.output}/#{@env.fnb}" + z=SiSU_Env::CleanOutput.new(@opt) if SiSU_Env::InfoSettings.new.permission?('zap') - tell=SiSU_Screen::Ansi.new(@opt.cmd,"Clean files related to processing #{@opt.cmd} ->","#{@opt.fns} -> #{@zap_path}") - @zap.zap.main_output - @zap.zap.site_map - @zap.zap.epub - @zap.zap.src - else tell=SiSU_Screen::Ansi.new(@opt.cmd,'use of -Z (zap) has not enabled in sisurc.yml') + unless @opt.cmd =~/q/ + tell=SiSU_Screen::Ansi.new(@opt.cmd,"Clean files related to processing #{@opt.cmd} ->","#{@opt.fns} -> #{zap_path}") + tell.warn + end + z.zap.remove_output + else + unless @opt.cmd =~/q/ + tell=SiSU_Screen::Ansi.new(@opt.cmd,'use of -Z (zap) has not enabled in sisurc.yml') + tell.warn + end end - tell.warn unless @opt.cmd =~/q/ end end end |