diff options
author | Ralph Amissah <ralph@amissah.com> | 2012-06-23 02:15:29 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2012-06-23 02:15:29 -0400 |
commit | 1925f55680720446c240880324b87fb52264f89e (patch) | |
tree | a32b13105f7b308d0560d69f628ff71f880f3f08 | |
parent | debian/changelog (3.3.0-1) (diff) | |
parent | v3: sysenv, rsync put (post to remote site), fix, needs comprehensive check (diff) |
Merge tag 'sisu_3.3.1' into debian/sid
-rw-r--r-- | data/doc/sisu/CHANGELOG_v3 | 23 | ||||
-rw-r--r-- | data/sisu/v3/v/version.yml | 6 | ||||
-rw-r--r-- | lib/sisu/v3/hub.rb | 736 | ||||
-rw-r--r-- | lib/sisu/v3/sysenv.rb | 47 | ||||
-rw-r--r-- | lib/sisu/v3/texpdf_format.rb | 12 |
5 files changed, 424 insertions, 400 deletions
diff --git a/data/doc/sisu/CHANGELOG_v3 b/data/doc/sisu/CHANGELOG_v3 index 4e9298af..d86a7fbf 100644 --- a/data/doc/sisu/CHANGELOG_v3 +++ b/data/doc/sisu/CHANGELOG_v3 @@ -13,13 +13,30 @@ Reverse Chronological: %% Development branch UNSTABLE v3 branch once stable will supersede & replace current stable v2 branch +%% 3.3.1.orig.tar.xz (2012-06-23:25/6) +http://git.sisudoc.org/?p=code/sisu.git;a=log;h=refs/tags/sisu_3.3.1 +http://git.sisudoc.org/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_3.3.1-1 +http://www.jus.uio.no/sisu/pkg/src/sisu_3.3.1.orig.tar.xz + sisu_3.3.1.orig.tar.xz + sisu_3.3.1-1.dsc + sisu_3.3.1-1.debian.tar.gz + + * v3: texpdf_format, urls in headings break pdf documents, fix + (e.g. output generation of document sample gpl.fsf.sst pdf fixed) + + * v3: sysenv, rsync put (post to remote site), fix, needs comprehensive check + (broken since version 3 (did not cope with alternative output structures), + start to fix; still broken: rsync get (sisu source); also scp put & get) + + * v3: hub, some re-arrangement + %% 3.3.0.orig.tar.xz (2012-06-17:24/7) http://git.sisudoc.org/?p=code/sisu.git;a=log;h=refs/tags/sisu_3.3.0 http://git.sisudoc.org/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_3.3.0-1 http://www.jus.uio.no/sisu/pkg/src/sisu_3.3.0.orig.tar.xz - sisu_3.3.0.orig.tar.xz - sisu_3.3.0-1.dsc - sisu_3.3.0-1.debian.tar.gz + 7c2d94e2dbeacde2ddddf30df05243139e79a91d0e10f80dbf557886179cf499 1690288 sisu_3.3.0.orig.tar.xz + eb658f619029adb9d91d9798e5b4fe2d0a80458b441c68ae76929179b35615e0 1382 sisu_3.3.0-1.dsc + 61d0e0924662c0bf96a1d6669315ab75b435e7bbde179aaa9084922240280d20 296989 sisu_3.3.0-1.debian.tar.gz * v3: shared_sisupod_source, common build for sisu (markup) source representations to be used by sisupod.txz, git, (and src) diff --git a/data/sisu/v3/v/version.yml b/data/sisu/v3/v/version.yml index 1d8fbff1..8fd6aa7a 100644 --- a/data/sisu/v3/v/version.yml +++ b/data/sisu/v3/v/version.yml @@ -1,5 +1,5 @@ --- -:version: 3.3.0 -:date_stamp: 2012w24/7 -:date: "2012-06-17" +:version: 3.3.1 +:date_stamp: 2012w25/6 +:date: "2012-06-23" :project: SiSU diff --git a/lib/sisu/v3/hub.rb b/lib/sisu/v3/hub.rb index f221c9a8..c4eed640 100644 --- a/lib/sisu/v3/hub.rb +++ b/lib/sisu/v3/hub.rb @@ -57,8 +57,8 @@ =end module SiSU - require_relative 'constants' # constants.rb - require_relative 'sysenv' # sysenv.rb + require_relative 'constants' # constants.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Screen @@pwd_the=Dir.pwd class OptionLoopFiles @@ -162,30 +162,30 @@ module SiSU end def remote_put_base_site_rsync # -CR p "#{__LINE__}:#{__FILE__}" if @opt.act[:maintenance][:set] ==:on - require_relative 'remote' # remote.rb + require_relative 'remote' # remote.rb SiSU_Remote::Put.new(@opt).rsync_base end def remote_put_base_site_rsync_match # -CCRZ p "#{__LINE__}:#{__FILE__}" if @opt.act[:maintenance][:set] ==:on - require_relative 'remote' # remote.rb + require_relative 'remote' # remote.rb SiSU_Remote::Put.new(@opt).rsync_base_sync end def remote_put_base_site # -Cr p "#{__LINE__}:#{__FILE__}" if @opt.act[:maintenance][:set] ==:on - require_relative 'remote' # remote.rb + require_relative 'remote' # remote.rb SiSU_Remote::Put.new(@opt).scp_base end def remote_put_base_site_all # -CCr p "#{__LINE__}:#{__FILE__}" if @opt.act[:maintenance][:set] ==:on - require_relative 'remote' # remote.rb + require_relative 'remote' # remote.rb SiSU_Remote::Put.new(@opt).scp_base_all end - def cgi # -F - require_relative 'cgi' # cgi.rb + def cgi # -F + require_relative 'cgi' # cgi.rb SiSU_CGI::SearchSQL.new(@opt).read end - def encoding # -K build character encoding db (uses KirbyBase) - require_relative 'character_encoding' # character_encoding.rb + def encoding # -K build character encoding db (uses KirbyBase) + require_relative 'character_encoding' # character_encoding.rb SiSU_CharacterEncode::Create.new.db end def termsheet # -t @@ -236,389 +236,393 @@ p "#{__LINE__}:#{__FILE__}" if @opt.act[:maintenance][:set] ==:on @msg,@msgs='',nil @tell=lambda { SiSU_Screen::Ansi.new(@opt.cmd,@msg,"#{@msgs.inspect if @msgs}") } end - def requires(req) - require_relative req + def do_loops + do_each_file_loop_options + do_loop_files_on_given_option_post end - def actions - if @opt.act[:profile][:set]==:on - require 'profile' - end - if @opt.act[:harvest][:set]==:on - require_relative 'harvest' # harvest.rb - SiSU_Harvest::Source.new(@opt).read # -h -H html.rb - elsif @opt.mod.inspect =~/--convert|--to|--from/ - require_relative 'sst_convert_markup' # sst_convert_markup.rb - elsif @opt.cmd =~/([abCcDdeFGgHhIjikLMmNnoPpQqRrSsTtUuVvWwXxYyZ_0-9])/ \ - and @opt.cmd =~/^-/ \ - and @opt.mod.inspect !~/--(?:sitemaps|query|identify)/ \ - or @opt.mod.inspect =~/--(?:(?:sq)?lite|pg(?:sql)?)/ - @cX=SiSU_Screen::Ansi.new(@opt.cmd).cX - flag=SiSU_Env::InfoProcessingFlag.new - if @opt.cmd =~/[vVM]/ #% version information - unless @opt.files.empty? - SiSU_Help::Help.new('env',@opt).sisu_version - end + def do_each_file_loop_options + @opt.files.each_with_index do |fno,i| + @opt.fno=fno + @opt.fns=fno.gsub(/(?:https?|file):\/\/\S+\/(\S+)\.sst$/,'\1.-sst'). + gsub(/\.ssm$/,'.ssm.sst') + @opt.f_pth=@opt.f_pths[i] + if @opt.fns !~/\.-sst$/ + @opt.pth=@opt.f_pths[i][:pth] + @opt.lng=@opt.f_pths[i][:lng] + else + @opt.pth=Dir.pwd + @opt.lng='en' end - if @opt.act[:license][:set]==:on #% license information - SiSU_Help::Help.new('license',@opt).help_request - end - if @opt.act[:dal][:set]==:on \ - or @opt.act[:maintenance][:set]==:on #% --maintenance, -m for -C - path={} - path[:css]=@@env.path.output + '/_sisu/css' - path[:xml]=@@env.path.output + '/_sisu/xml' - path[:xsd]=path[:xml] + '/xsd' - path[:xsd]=path[:xml] + '/rnc' - path[:xsd]=path[:xml] + '/rng' - re_p3=/(sisupod(?:\.txz)?|\S+?\.ss[mt]\.txz|[^\/]+?\.ssp)$/ - unless @opt.files.join(',') =~ re_p3 #do not mix pods with source markup files in command line - # unless ( FileTest.directory?(path[:css]) \ - # and FileTest.directory?(path[:xsd]) ) - # @opt.cmd=@opt.cmd +='C' unless @opt.cmd =~/C/ #FIX - # end - if @opt.act[:maintenance][:set] ==:on - $VERBOSE=false #debug $VERBOSE=true - end - end - re_p2=/(sisupod(?:\.zip)?|\S+?\.ss[mt]\.zip)$/ - unless @opt.files.join(',') =~ re_p2 #do not mix pods with source markup files in command line - # unless ( FileTest.directory?(path[:css]) \ - # and FileTest.directory?(path[:xsd]) ) - # @opt.cmd=@opt.cmd +='C' unless @opt.cmd =~/C/ #FIX - # end - if @opt.act[:maintenance][:set] ==:on - $VERBOSE=false #debug $VERBOSE=true - end - end + unless @opt.pth.nil? + @@pwd=@opt.pth + Dir.chdir(@opt.pth) #watch end - if @opt.act[:site_init][:set]==:on #% --init-site, -C initialize/configure - requires('conf') #% --init-site, -C initialize/configure - SiSU_Initialize::Source.new(@opt).read - if @opt.act[:rsync][:set]==:on - if @opt.mod.inspect =~/--init(?:ialize)?=site/ \ - and @opt.cmd =~/RZ/ - SiSU::Operations.new(@opt).remote_put_base_site_rsync_match - else SiSU::Operations.new(@opt).remote_put_base_site_rsync - end - elsif @opt.act[:scp][:set]==:on - if @opt.mod.inspect =~/--init(?:ialize)?=site/ \ - and @opt.cmd =~/CCr/ - SiSU::Operations.new(@opt).remote_put_base_site_all - else SiSU::Operations.new(@opt).remote_put_base_site - end + @env=SiSU_Env::InfoEnv.new(@opt.fns) + if @opt.act[:dal][:set]==:on #% --dal, -m + unless @opt.act[:po4a][:set]==:on # --po4a, -P + if @opt.fno =~ /\.ssm$/ + require_relative 'composite' # composite.rb #pre-processing + SiSU_Assemble::Composite.new(@opt).read + end + require_relative 'dal' # -m dal.rb + SiSU_DAL::Source.new(@opt).read end end - if @opt.act[:sample_search_form][:set]==:on #% --sample-search-form, -F cgi sample search form - SiSU::Operations.new(@opt).cgi - end - 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 - #requires('zap') - #SiSU_Zap::Source.new(@opt).read # -Z zap.rb - end - if @opt.act[:dal][:set]==:on - @retry_count= -1 - begin - path_image='./_sisu/processing/external_document/image' - path_skin='./_sisu/processing/external_document/skin/doc' - @get_s,@get_p,@get_pl=[],[],[] - re_s=/(\S+?\.-sst)$/ - re_p3=/((?:https?|file):\/\/\S+?(?:\/\S+?\.ss[mt]\.txz|sisupod(?:\.txz)?|\.ssp))/ - re_pl3=/^(\/\S+?\.ss[mt]\.txz)/ - @opt.files.each do |fns| - if fns =~re_s - @get_s << @opt.f_pths[0][:url] - end - if fns =~re_p3 - @get_p << re_p3.match(fns)[1] if re_p3 - end - if fns =~re_pl3 - @get_pl << re_pl3.match(fns)[1] if re_p3 - end - end - if @get_s.length > 0 #% remote markup file .sst - require_relative 'remote' # remote.rb - SiSU_Remote::Get.new(@opt,@get_s).fns - SiSU::Operations.new.counter - end - if @get_p.length > 0 #% remote sisupod - require_relative 'remote' # remote.rb - SiSU_Remote::Get.new(@opt,@get_p).sisupod - end - rescue - SiSU_Errors::InfoError.new($!,$@,@opt,@fns).error do - __LINE__.to_s + ':' + __FILE__ - end - @retry_count +=1 - retry unless @retry_count > 1 - ensure - end + if @opt.act[:qrcode][:set]==:on #% --qrcode, -Q + require_relative 'qrcode' # -Q qrcode.rb + SiSU_QRcode::Source.new(@opt).read end - def each_file_loop_options - @opt.files.each_with_index do |fno,i| - @opt.fno=fno - @opt.fns=fno.gsub(/(?:https?|file):\/\/\S+\/(\S+)\.sst$/,'\1.-sst'). - gsub(/\.ssm$/,'.ssm.sst') - @opt.f_pth=@opt.f_pths[i] - if @opt.fns !~/\.-sst$/ - @opt.pth=@opt.f_pths[i][:pth] - @opt.lng=@opt.f_pths[i][:lng] - else - @opt.pth=Dir.pwd - @opt.lng='en' - end - unless @opt.pth.nil? - @@pwd=@opt.pth - Dir.chdir(@opt.pth) #watch - end - @env=SiSU_Env::InfoEnv.new(@opt.fns) - if @opt.act[:dal][:set]==:on #% --dal, -m - unless @opt.act[:po4a][:set]==:on # --po4a, -P - if @opt.fno =~ /\.ssm$/ - require_relative 'composite' # composite.rb #pre-processing - SiSU_Assemble::Composite.new(@opt).read - end - requires('dal') # -m dal.rb - SiSU_DAL::Source.new(@opt).read - end - end - if @opt.act[:qrcode][:set]==:on #% --qrcode, -Q - requires('qrcode') # -Q qrcode.rb - SiSU_QRcode::Source.new(@opt).read - end - if @opt.act[:hash_digests][:set]==:on #% --hash-digests, -N digest tree - requires('digests') # -N digests.rb - SiSU_DigestView::Source.new(@opt).read - end - if @opt.act[:txt][:set]==:on #% --txt, -t -a - requires('plaintext') # -t -a plaintext.rb - SiSU_Plaintext::Source.new(@opt).read - end - if @opt.act[:html][:set]==:on #% --html, -h - requires('html') # -h -H html.rb - SiSU_HTML::Source.new(@opt).read - end - if @opt.act[:concordance][:set]==:on #% --concordance, -w - requires('concordance') # -w concordance.rb - SiSU_Concordance::Source.new(@opt).read - end - if @opt.act[:epub][:set]==:on #% --epub, -e - requires('epub') # -e epub.rb - SiSU_EPUB::Source.new(@opt).read - end - if @opt.act[:odt][:set]==:on #% --odt, -o opendocument - requires('odf') # -o odf.rb - SiSU_ODF::Source.new(@opt).read - end - if @opt.act[:xhtml][:set]==:on #% --xhtml, -b xhtml - requires('xhtml') # -b xhtml.rb - SiSU_XHTML::Source.new(@opt).read - end - if @opt.act[:xml_sax][:set]==:on #% --xml-sax, -x xml sax type - requires('xml') # -x xml.rb - SiSU_XML_SAX::Source.new(@opt).read - end - if @opt.act[:xml_dom][:set]==:on #% --xml-dom, -x xml dom type - requires('xml_dom') # -X xml_dom.rb - SiSU_XML_DOM::Source.new(@opt).read - end - if @opt.act[:pdf][:set]==:on #% --pdf, -p latex/ texpdf - requires('texpdf') # -p texpdf.rb - SiSU_TeX::Source.new(@opt).read - end - if @opt.act[:manpage][:set]==:on #% --manpage, -i - requires('manpage') # -i manpage.rb - SiSU_Manpage::Source.new(@opt).read - end - if @opt.act[:texinfo][:set]==:on #% --texinfo, -I - requires('texinfo') # -I texinfo.rb - SiSU_TexInfo::Source.new(@opt).read - end - if @opt.act[:sqlite_discreet][:set]==:on #% --sqlite, -d DB sqlite - requires('dbi_discreet') # -d dbi_discreet.rb - SiSU_DBI_Discreet::SQL.new(@opt).build - end - if @opt.act[:manifest][:set]==:on #% --manifest, -y - requires('manifest') # -y manifest.rb - SiSU_Manifest::Source.new(@opt).read - end + if @opt.act[:hash_digests][:set]==:on #% --hash-digests, -N digest tree + require_relative 'digests' # -N digests.rb + SiSU_DigestView::Source.new(@opt).read + end + if @opt.act[:txt][:set]==:on #% --txt, -t -a + require_relative 'plaintext' # -t -a plaintext.rb + SiSU_Plaintext::Source.new(@opt).read + end + if @opt.act[:html][:set]==:on #% --html, -h + require_relative 'html' # -h -H html.rb + SiSU_HTML::Source.new(@opt).read + end + if @opt.act[:concordance][:set]==:on #% --concordance, -w + require_relative 'concordance' # -w concordance.rb + SiSU_Concordance::Source.new(@opt).read + end + if @opt.act[:epub][:set]==:on #% --epub, -e + require_relative 'epub' # -e epub.rb + SiSU_EPUB::Source.new(@opt).read + end + if @opt.act[:odt][:set]==:on #% --odt, -o opendocument + require_relative 'odf' # -o odf.rb + SiSU_ODF::Source.new(@opt).read + end + if @opt.act[:xhtml][:set]==:on #% --xhtml, -b xhtml + require_relative 'xhtml' # -b xhtml.rb + SiSU_XHTML::Source.new(@opt).read + end + if @opt.act[:xml_sax][:set]==:on #% --xml-sax, -x xml sax type + require_relative 'xml' # -x xml.rb + SiSU_XML_SAX::Source.new(@opt).read + end + if @opt.act[:xml_dom][:set]==:on #% --xml-dom, -X xml dom type + require_relative 'xml_dom' # -X xml_dom.rb + SiSU_XML_DOM::Source.new(@opt).read + end + if @opt.act[:pdf][:set]==:on #% --pdf, -p latex/ texpdf + require_relative 'texpdf' # -p texpdf.rb + SiSU_TeX::Source.new(@opt).read + end + if @opt.act[:manpage][:set]==:on #% --manpage, -i + require_relative 'manpage' # -i manpage.rb + SiSU_Manpage::Source.new(@opt).read + end + if @opt.act[:texinfo][:set]==:on #% --texinfo, -I + require_relative 'texinfo' # -I texinfo.rb + SiSU_TexInfo::Source.new(@opt).read + end + if @opt.act[:sqlite_discreet][:set]==:on #% --sqlite, -d DB sqlite + require_relative 'dbi_discreet' # -d dbi_discreet.rb + SiSU_DBI_Discreet::SQL.new(@opt).build + end + if @opt.act[:manifest][:set]==:on #% --manifest, -y + require_relative 'manifest' # -y manifest.rb + SiSU_Manifest::Source.new(@opt).read + 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 + OptionLoopFiles.new(@opt).loop_files_on_given_option do + SiSU_Doc::Source.new(@opt).read end + ensure + SiSU_Doc::Source.new(@opt).sisupod_tar_xz end - def pre_loop_files_on_given_option_do - if @opt.act[:sisupod][:set]==:on #% --sisupod, -S make sisupod - requires('sisupod_make') # -S sisupod_make.rb + end + end + def do_loop_files_on_given_option_post + if @opt.act[:share_source][:set]==:on \ + or @opt.act[:sisupod][:set]==:on \ + or @opt.act[:git][:set]==:on + begin + require_relative 'shared_sisupod_source' + OptionLoopFiles.new(@opt).loop_files_on_given_option do + SiSU_Source::SiSUpodSource.new(@opt).read + end + if @opt.act[:share_source][:set]==:on +#REDO + require_relative 'share_src' # -s share_src.rb begin - OptionLoopFiles.new(@opt).loop_files_on_given_option do - 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_Markup::Source.new(@opt).read + end end end - end - def post_loop_files_on_given_option_do - if @opt.act[:share_source][:set]==:on \ - or @opt.act[:sisupod][:set]==:on \ - or @opt.act[:git][:set]==:on + if @opt.act[:sisupod][:set]==:on #% --sisupod, -S make sisupod + require_relative 'sisupod_make' # -S sisupod_make.rb begin - requires('shared_sisupod_source') - OptionLoopFiles.new(@opt).loop_files_on_given_option do - SiSU_Source::SiSUpodSource.new(@opt).read - end - if @opt.act[:share_source][:set]==:on -#REDO - requires('share_src') # -s share_src.rb - begin - ensure - OptionLoopFiles.new(@opt).loop_files_on_given_option_bundle do - SiSU_Markup::Source.new(@opt).read - end - end - end - if @opt.act[:sisupod][:set]==:on #% --sisupod, -S make sisupod - requires('sisupod_make') # -S sisupod_make.rb - begin - ensure - OptionLoopFiles.new(@opt).loop_files_on_given_option_bundle do - SiSU_Doc::Source.new(@opt).sisupod_tar_xz - end - end - end - if @opt.act[:git][:set]==:on #% --git, -g sisu git - requires('git') # -g git.rb - begin - OptionLoopFiles.new(@opt).loop_files_on_given_option do - SiSU_Git::Source.new(@opt).read - end - ensure - OptionLoopFiles.new(@opt).loop_files_on_given_option_bundle do - SiSU_Git::Source.new(@opt).git_commit - end - end - end ensure - path_pod=@env.processing_path.processing_sisupod(@opt).paths - unless @opt.cmd =~/M/ - FileUtils::rm_rf("#{path_pod[:sisupod]}/*") if FileTest.directory?(path_pod[:sisupod]) - #FileUtils::rm_rf("#{path_pod[:fnb]}/*") if FileTest.directory?(path_pod[:fnb]) + OptionLoopFiles.new(@opt).loop_files_on_given_option_bundle do + SiSU_Doc::Source.new(@opt).sisupod_tar_xz end end end - if @opt.act[:po4a][:set]==:on #% --po4a, -P - requires('po4a') + if @opt.act[:git][:set]==:on #% --git, -g sisu git + require_relative 'git' # -g git.rb begin OptionLoopFiles.new(@opt).loop_files_on_given_option do - SiSU_Po4a::Source.new(@opt).read # -P po4a.rb + SiSU_Git::Source.new(@opt).read end ensure + OptionLoopFiles.new(@opt).loop_files_on_given_option_bundle do + SiSU_Git::Source.new(@opt).git_commit + end end end - if @opt.act[:images][:set]==:on #% --images, -j - requires('shared_images') - OptionLoopFiles.new(@opt).loop_files_on_given_option do - SiSU_Images::Source.new(@opt).read # -j shared_images.rb - end + ensure + path_pod=@env.processing_path.processing_sisupod(@opt).paths + unless @opt.cmd =~/M/ + FileUtils::rm_rf("#{path_pod[:sisupod]}/*") if FileTest.directory?(path_pod[:sisupod]) + #FileUtils::rm_rf("#{path_pod[:fnb]}/*") if FileTest.directory?(path_pod[:fnb]) end - if @opt.cmd =~/T/ #% -T termsheet/standard form - SiSU_Help::Help.new('termsheet').help_request - @opt.files.each do |fns| - if FileTest.file?(fns) - @opt.fns=fns - case @opt.fns - when /\.(termsheet.rb)$/ - SiSU::Operations.new(@opt).termsheet - else #print "not processed --> ", fns, "\n" - end - else SiSU::Operations.new(@opt).not_found - end - end - SiSU::Operations.new.counter + end + end + if @opt.act[:po4a][:set]==:on #% --po4a, -P + require_relative 'po4a' + begin + OptionLoopFiles.new(@opt).loop_files_on_given_option do + SiSU_Po4a::Source.new(@opt).read # -P po4a.rb end - if @opt.cmd =~/k/ #% -k temporary tests - OptionLoopFiles.new(@opt).loop_files_on_given_option do - #requires('xml_scaffold') - #fix - end + ensure + end + end + if @opt.act[:images][:set]==:on #% --images, -j + require_relative 'shared_images' + OptionLoopFiles.new(@opt).loop_files_on_given_option do + SiSU_Images::Source.new(@opt).read # -j shared_images.rb + end + end + if @opt.cmd =~/T/ #% -T termsheet/standard form + SiSU_Help::Help.new('termsheet').help_request + @opt.files.each do |fns| + if FileTest.file?(fns) + @opt.fns=fns + case @opt.fns + when /\.(termsheet.rb)$/ + SiSU::Operations.new(@opt).termsheet + else #print "not processed --> ", fns, "\n" + end + else SiSU::Operations.new(@opt).not_found end - if @opt.act[:psql][:set]==:on #% --pg, -D DB postgresql - requires('dbi') - if @opt.files.length > 0 #switch test to actual commands - OptionLoopFiles.new(@opt).loop_files_on_given_option do - SiSU_DBI::SQL.new(@opt).connect # -D -d dbi.rb - end - else - SiSU_DBI::SQL.new(@opt).connect # -D -d dbi.rb - end + end + SiSU::Operations.new.counter + end + if @opt.cmd =~/k/ #% -k temporary tests + OptionLoopFiles.new(@opt).loop_files_on_given_option do + #require_relative 'xml_scaffold' + #fix + end + end + if @opt.act[:psql][:set]==:on #% --pg, -D DB postgresql + require_relative 'dbi' + if @opt.files.length > 0 #switch test to actual commands + OptionLoopFiles.new(@opt).loop_files_on_given_option do + SiSU_DBI::SQL.new(@opt).connect # -D -d dbi.rb end - if @opt.act[:sqlite][:set]==:on #% --sqlite, -d DB sqlite - requires('dbi') - if @opt.files.length > 0 #switch test to actual commands - OptionLoopFiles.new(@opt).loop_files_on_given_option do - SiSU_DBI::SQL.new(@opt).connect # -D -d dbi.rb - end - else - SiSU_DBI::SQL.new(@opt).connect # -D -d dbi.rb - end + else + SiSU_DBI::SQL.new(@opt).connect # -D -d dbi.rb + end + end + if @opt.act[:sqlite][:set]==:on #% --sqlite, -d DB sqlite + require_relative 'dbi' + if @opt.files.length > 0 #switch test to actual commands + OptionLoopFiles.new(@opt).loop_files_on_given_option do + SiSU_DBI::SQL.new(@opt).connect # -D -d dbi.rb + end + else + SiSU_DBI::SQL.new(@opt).connect # -D -d dbi.rb + end + end + if @opt.act[:dal][:set]==:on #% --dal, -m embedded content + # OptionLoopFiles.new(@opt).loop_files_on_given_option do + # require_relative 'embedded' + # SiSU_Embedded::Source.new(@opt).read # -m embedded.rb (image and other content) #check + # 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[:sisupod][:set]==:on #% --sisupod, -S make sisupod + # OptionLoopFiles.new(@opt).loop_files_on_given_option do + # require_relative 'sisupod_make' + # SiSU_Doc::Source.new(@opt).read # -S sisupod_make.rb + # end + end + if @opt.act[:manifest][:set]==:on #% --manifest, -y + require_relative 'manifest' + OptionLoopFiles.new(@opt).manifest_on_files_translated do + SiSU_Manifest::Source.new(@opt).read # -y manifest.rb + end + end + if @opt.act[:sitemap][:set]==:on #% --sitemap, -Y + require_relative 'sitemaps' + OptionLoopFiles.new(@opt).loop_files_on_given_option do + SiSU_Sitemaps::Source.new(@opt).read # -Y sitemaps.rb + end + end + if @opt.act[:harvest][:set] !=:on + if @opt.act[:scp][:set]==:on #% -r copy to remote server + require_relative 'remote' # -r remote.rb + OptionLoopFiles.new(@opt).loop_files_on_given_option do + SiSU_Remote::Put.new(@opt).scp + end + end + if @opt.act[:rsync][:set]==:on #% -R copy to remote server + require_relative 'remote' # -R remote.rb + OptionLoopFiles.new(@opt).loop_files_on_given_option do + SiSU_Remote::Put.new(@opt).rsync + end + end + else + end + if @opt.act[:urls_selected][:set]==:on #% --sitemap, -Y + require_relative 'urls' + OptionLoopFiles.new(@opt).loop_files_on_given_option do + SiSU_Urls::Source.new(@opt).read #% -u -v -V -M + end + end + end + def do_initialization + @cX=SiSU_Screen::Ansi.new(@opt.cmd).cX + flag=SiSU_Env::InfoProcessingFlag.new + if @opt.cmd =~/[vVM]/ #% version information + unless @opt.files.empty? + SiSU_Help::Help.new('env',@opt).sisu_version + end + end + if @opt.act[:license][:set]==:on #% license information + SiSU_Help::Help.new('license',@opt).help_request + end + if @opt.act[:dal][:set]==:on \ + or @opt.act[:maintenance][:set]==:on #% --maintenance, -m for -C + path={} + path[:css]=@@env.path.output + '/_sisu/css' + path[:xml]=@@env.path.output + '/_sisu/xml' + path[:xsd]=path[:xml] + '/xsd' + path[:xsd]=path[:xml] + '/rnc' + path[:xsd]=path[:xml] + '/rng' + re_p3=/(sisupod(?:\.txz)?|\S+?\.ss[mt]\.txz|[^\/]+?\.ssp)$/ + unless @opt.files.join(',') =~ re_p3 #do not mix pods with source markup files in command line + # unless ( FileTest.directory?(path[:css]) \ + # and FileTest.directory?(path[:xsd]) ) + # @opt.cmd=@opt.cmd +='C' unless @opt.cmd =~/C/ #FIX + # end + if @opt.act[:maintenance][:set] ==:on + $VERBOSE=false #debug $VERBOSE=true end - if @opt.act[:dal][:set]==:on #% --dal, -m embedded content - # OptionLoopFiles.new(@opt).loop_files_on_given_option do - # requires('embedded') - # SiSU_Embedded::Source.new(@opt).read # -m embedded.rb (image and other content) #check - # end + end + re_p2=/(sisupod(?:\.zip)?|\S+?\.ss[mt]\.zip)$/ + unless @opt.files.join(',') =~ re_p2 #do not mix pods with source markup files in command line + # unless ( FileTest.directory?(path[:css]) \ + # and FileTest.directory?(path[:xsd]) ) + # @opt.cmd=@opt.cmd +='C' unless @opt.cmd =~/C/ #FIX + # end + if @opt.act[:maintenance][:set] ==:on + $VERBOSE=false #debug $VERBOSE=true end - if @opt.act[:zap][:set]==:on #% --zap, -Z - # OptionLoopFiles.new(@opt).loop_files_on_given_option do - # requires('zap') - # SiSU_Zap::Source.new(@opt).read # -Z zap.rb - # end + end + end + if @opt.act[:site_init][:set]==:on #% --init-site, -C initialize/configure + require_relative 'conf' #% --init-site, -C initialize/configure + SiSU_Initialize::Source.new(@opt).read + if @opt.act[:rsync][:set]==:on + if @opt.mod.inspect =~/--init(?:ialize)?=site/ \ + and @opt.cmd =~/RZ/ + SiSU::Operations.new(@opt).remote_put_base_site_rsync_match + else SiSU::Operations.new(@opt).remote_put_base_site_rsync end - if @opt.act[:sisupod][:set]==:on #% --sisupod, -S make sisupod - # OptionLoopFiles.new(@opt).loop_files_on_given_option do - # requires('sisupod_make') - # SiSU_Doc::Source.new(@opt).read # -S sisupod_make.rb - # end + elsif @opt.act[:scp][:set]==:on + if @opt.mod.inspect =~/--init(?:ialize)?=site/ \ + and @opt.cmd =~/CCr/ + SiSU::Operations.new(@opt).remote_put_base_site_all + else SiSU::Operations.new(@opt).remote_put_base_site end - if @opt.act[:manifest][:set]==:on #% --manifest, -y - requires('manifest') - OptionLoopFiles.new(@opt).manifest_on_files_translated do - SiSU_Manifest::Source.new(@opt).read # -y manifest.rb + end + end + if @opt.act[:sample_search_form][:set]==:on #% --sample-search-form, -F cgi sample search form + SiSU::Operations.new(@opt).cgi + end + 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 + path_image='./_sisu/processing/external_document/image' + path_skin='./_sisu/processing/external_document/skin/doc' + @get_s,@get_p,@get_pl=[],[],[] + re_s=/(\S+?\.-sst)$/ + re_p3=/((?:https?|file):\/\/\S+?(?:\/\S+?\.ss[mt]\.txz|sisupod(?:\.txz)?|\.ssp))/ + re_pl3=/^(\/\S+?\.ss[mt]\.txz)/ + @opt.files.each do |fns| + if fns =~re_s + @get_s << @opt.f_pths[0][:url] + end + if fns =~re_p3 + @get_p << re_p3.match(fns)[1] if re_p3 + end + if fns =~re_pl3 + @get_pl << re_pl3.match(fns)[1] if re_p3 end end - if @opt.act[:sitemap][:set]==:on #% --sitemap, -Y - requires('sitemaps') - OptionLoopFiles.new(@opt).loop_files_on_given_option do - SiSU_Sitemaps::Source.new(@opt).read # -Y sitemaps.rb - end + if @get_s.length > 0 #% remote markup file .sst + require_relative 'remote' # remote.rb + SiSU_Remote::Get.new(@opt,@get_s).fns + SiSU::Operations.new.counter end - if @opt.act[:harvest][:set] !=:on - if @opt.act[:scp][:set]==:on #% -r copy to remote server - OptionLoopFiles.new(@opt).loop_files_on_given_option do - SiSU_Remote::Put.new(@opt).scp # -r - end - end - if @opt.act[:rsync][:set]==:on #% -R copy to remote server - OptionLoopFiles.new(@opt).loop_files_on_given_option do - SiSU_Remote::Put.new(@opt).rsync # -R - end - end - else + if @get_p.length > 0 #% remote sisupod + require_relative 'remote' # remote.rb + SiSU_Remote::Get.new(@opt,@get_p).sisupod end - if @opt.act[:urls_selected][:set]==:on #% --sitemap, -Y - requires('urls') - OptionLoopFiles.new(@opt).loop_files_on_given_option do - SiSU_Urls::Source.new(@opt).read #% -u -v -V -M - end + rescue + SiSU_Errors::InfoError.new($!,$@,@opt,@fns).error do + __LINE__.to_s + ':' + __FILE__ end + @retry_count +=1 + retry unless @retry_count > 1 + ensure end - if @opt.act[:site_init][:set]==:on #% -C - requires('conf') # -s conf.rb - SiSU_Initialize::Source.new(@opt).read - end - #pre_loop_files_on_given_option_do - each_file_loop_options - post_loop_files_on_given_option_do + end + if @opt.act[:site_init][:set]==:on #% -C + require_relative 'conf' # -s conf.rb + SiSU_Initialize::Source.new(@opt).read + end + end + def actions + if @opt.act[:profile][:set]==:on + require 'profile' + end + if @opt.act[:harvest][:set]==:on + require_relative 'harvest' # harvest.rb + SiSU_Harvest::Source.new(@opt).read # -h -H html.rb + elsif @opt.mod.inspect =~/--convert|--to|--from/ + require_relative 'sst_convert_markup' # sst_convert_markup.rb + elsif @opt.cmd =~/([abCcDdeFGgHhIjikLMmNnoPpQqRrSsTtUuVvWwXxYyZ_0-9])/ \ + and @opt.cmd =~/^-/ \ + and @opt.mod.inspect !~/--(?:sitemaps|query|identify)/ \ + or @opt.mod.inspect =~/--(?:(?:sq)?lite|pg(?:sql)?)/ + do_initialization + do_loops @msg,@msgs="\tsisu -W [to start ruby web-server on output directory]\n",nil unless @opt.act[:quiet][:set] ==:on @tell.call.print_brown if @opt.cmd =~/[uUvVM]/ unless @opt.files.join.empty? if defined? @@env.processing_path.processing \ @@ -635,18 +639,18 @@ p "#{__LINE__}:#{__FILE__}" if @opt.act[:maintenance][:set] ==:on elsif @opt.mod.inspect =~/--identify/ require_relative 'sst_identify_markup' # sst_identify_markup.rb markup_version=SiSU_Markup::MarkupIdentify.new(@opt).markup_version? - elsif @opt.mod.inspect =~/--about/ #% help instructions + elsif @opt.mod.inspect =~/--about/ #% help instructions if @opt.mod.inspect =~/--about/ \ and not @opt.what.empty? SiSU_Help::Help.new(@opt.what,'color_off').help_request else SiSU_Help::Help.new('list','color_off').help_request end - elsif @opt.mod.inspect =~/--sitemaps/ #% sitemaps - require_relative 'sitemaps' # sitemaps.rb + elsif @opt.mod.inspect =~/--sitemaps/ #% sitemaps + require_relative 'sitemaps' # sitemaps.rb SiSU_Sitemaps::Source.new(@opt).read if @opt.act[:rsync][:set]==:on - require_relative 'remote' # remote.rb + require_relative 'remote' # remote.rb SiSU_Remote::Put.new(@opt).rsync_sitemaps end else #% help instructions @@ -693,15 +697,15 @@ p "#{__LINE__}:#{__FILE__}" if @opt.act[:maintenance][:set] ==:on require 'jcode' $KCODE='UTF8' end - require_relative 'constants' # constants.rb - require_relative 'options' # options.rb - require_relative 'sysenv' # sysenv.rb + require_relative 'constants' # constants.rb + require_relative 'options' # options.rb + require_relative 'sysenv' # sysenv.rb include SiSU_Env; include SiSU_Screen - require_relative 'param' # param.rb + require_relative 'param' # param.rb include SiSU_Param - require_relative 'defaults' # defaults.rb + require_relative 'defaults' # defaults.rb include SiSU_Viz - require_relative 'help' # help.rb + require_relative 'help' # help.rb include SiSU_Help require 'uri' home=ENV['HOME'] diff --git a/lib/sisu/v3/sysenv.rb b/lib/sisu/v3/sysenv.rb index 1527e634..ee881e43 100644 --- a/lib/sisu/v3/sysenv.rb +++ b/lib/sisu/v3/sysenv.rb @@ -3195,81 +3195,86 @@ WOK # SiSU_Env::SystemCall.new("#{local_src}/#{src_txt}",remote_src,@opt.cmd).rsync delete_extra_files='--delete' # '--delete-after' inp=[] - if (@opt.cmd =~/h/ \ + 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.cmd =~/w/ \ + 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.cmd =~/e/ \ + 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.cmd =~/o/ \ + 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.cmd =~/b/ \ + 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.cmd =~/x/ \ + 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.cmd =~/X/ \ + 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.cmd =~/[at]/ \ + 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.cmd =~/i/ \ + 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.cmd =~/I/ \ + 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.cmd =~/N/ \ + 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.cmd =~/s/ \ + 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.cmd =~/S/ \ + 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.cmd =~/p/ \ + if (@opt.act[:pdf][:set]==:on \ || @opt.cmd =~/^-[mqvVM]*R[mqvVM]*$/) inp << @f.output_path.pdf.rel + '/' + @opt.fnb + '*' end - if (@opt.cmd =~/Q/ \ + if (@opt.act[:sqlite_discreet][:set]==:on \ + || @opt.cmd =~/^-[mqvVM]*R[mqvVM]*$/) \ + && FileTest.file?(@f.place_file.sqlite_discreet.dir) + inp << @f.place_file.sqlite_discreet.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.cmd =~/y/ \ + if (@opt.act[:manifest][:set]==:on \ || @opt.cmd =~/^-[mqvVM]*R[mqvVM]*$/) \ && FileTest.file?(@f.place_file.manifest.dir) inp << @f.place_file.manifest.rel @@ -4781,16 +4786,10 @@ WOK end end def ab_src - if output_dir_structure.dump_or_redirect? - "." - elsif output_dir_structure.by_language_code? - "#{@ft}/#{@md.opt.lng}" - else - "#{@ft}" - end + @ft end def ab_pod - "#{@ft}" + @ft end self end diff --git a/lib/sisu/v3/texpdf_format.rb b/lib/sisu/v3/texpdf_format.rb index 75eadedc..43763157 100644 --- a/lib/sisu/v3/texpdf_format.rb +++ b/lib/sisu/v3/texpdf_format.rb @@ -217,7 +217,8 @@ module SiSU_TeX_Pdf dob=@dob title=@md.title.full dob.tmp=dob.tmp.strip if dob.tmp - dob.tmp=dob.tmp.gsub(/\\begin\{(bfseries|itshape)\}(.+?)\\end\{\1\}/m,'\2') + dob.tmp=dob.tmp.gsub(/\\begin\{(bfseries|itshape)\}(.+?)\\end\{\1\}/m,'\2'). + gsub(/#{Mx[:url_o]}|#{Mx[:url_c]}/,'') cont_ln=dob.tmp.dup cont_ln=cont_ln.gsub(/\\begin\{(monosp)\}(.+?)\\end\{\1\}/m,'\2'). gsub(@@tex_pattern_margin_number,'') @@ -235,7 +236,8 @@ module SiSU_TeX_Pdf def level4 dob=@dob dob.tmp=dob.tmp.strip if dob.tmp - dob.tmp=dob.tmp.gsub(/\\begin\{(bfseries|itshape)\}(.+?)\\end\{\1\}/m,'\2') + dob.tmp=dob.tmp.gsub(/\\begin\{(bfseries|itshape)\}(.+?)\\end\{\1\}/m,'\2'). + gsub(/#{Mx[:url_o]}|#{Mx[:url_c]}/,'') cont_ln=dob.tmp.dup cont_ln=cont_ln.gsub(/\\begin\{(monosp)\}(.+?)\\end\{\1\}/m,'\2'). gsub(@@tex_pattern_margin_number,''). @@ -259,7 +261,8 @@ module SiSU_TeX_Pdf dob=@dob # there is a problem here with creation of headers does not do what you would want it to header starts with a * and is not in bold work on \\@txt*, same for next section 2002w46 dob.tmp=dob.tmp.strip if dob.tmp - dob.tmp=dob.tmp.gsub(/\\begin\{(bfseries|itshape)\}(.+?)\\end\{\1\}/m,'\2') + dob.tmp=dob.tmp.gsub(/\\begin\{(bfseries|itshape)\}(.+?)\\end\{\1\}/m,'\2'). + gsub(/#{Mx[:url_o]}|#{Mx[:url_c]}/,'') cont_ln=dob.tmp.dup cont_ln=cont_ln.gsub(/\\begin\{(monosp)\}(.+?)\\end\{\1\}/m,'\2'). gsub(@@tex_pattern_margin_number,''). @@ -280,7 +283,8 @@ module SiSU_TeX_Pdf dob=@dob # there is a problem here with creation of headers does not do what you would want it to header starts with a * and is not in bold work on \\sub@txt*, same for previous section 2002w46 dob.tmp=dob.tmp.strip if dob.tmp - dob.tmp=dob.tmp.gsub(/\\begin\{(bfseries|itshape)\}(.+?)\\end\{\1\}/m,'\2') + dob.tmp=dob.tmp.gsub(/\\begin\{(bfseries|itshape)\}(.+?)\\end\{\1\}/m,'\2'). + gsub(/#{Mx[:url_o]}|#{Mx[:url_c]}/,'') cont_ln=dob.tmp.dup cont_ln=cont_ln.gsub(/\\begin\{(monosp)\}(.+?)\\end\{\1\}/m,'\2'). gsub(@@tex_pattern_margin_number,''). |