diff options
| author | Ralph Amissah <ralph@amissah.com> | 2007-10-15 02:09:59 +0100 | 
|---|---|---|
| committer | Ralph Amissah <ralph@amissah.com> | 2007-10-15 02:09:59 +0100 | 
| commit | 7c6478d290c854f26d4b954bb5ed47871ceefd62 (patch) | |
| tree | 347b7fa55ed0412255757d1f081a5a32f9f02d49 | |
| parent | default image directories moved, more convenient/logical [test] (diff) | |
composite master renaming, and; multiple remote puts (rsync|scp)
* composite master files: eliminate ._sst, replace with .ssm.sst
* multiple remote hosts ("distributed" rsyncing), yml config files remote now
  uses array
with all recent changes (directory shunting) much testing is yet to be done,
state is unstable some things are known not to work this instant, e.g. sisu -V
| -rw-r--r-- | CHANGELOG | 7 | ||||
| -rw-r--r-- | conf/sisu/sisurc.yml | 11 | ||||
| -rw-r--r-- | data/doc/sisu/sisu_markup_samples/sisu_manual/_sisu/sisurc.yml | 11 | ||||
| -rw-r--r-- | lib/sisu/v0/composite.rb | 2 | ||||
| -rw-r--r-- | lib/sisu/v0/help.rb | 2 | ||||
| -rw-r--r-- | lib/sisu/v0/html_format.rb | 2 | ||||
| -rw-r--r-- | lib/sisu/v0/hub.rb | 20 | ||||
| -rw-r--r-- | lib/sisu/v0/manifest.rb | 4 | ||||
| -rw-r--r-- | lib/sisu/v0/manpage.rb | 2 | ||||
| -rw-r--r-- | lib/sisu/v0/odf.rb | 2 | ||||
| -rw-r--r-- | lib/sisu/v0/options.rb | 8 | ||||
| -rw-r--r-- | lib/sisu/v0/param.rb | 10 | ||||
| -rw-r--r-- | lib/sisu/v0/plaintext.rb | 2 | ||||
| -rw-r--r-- | lib/sisu/v0/remote.rb | 4 | ||||
| -rw-r--r-- | lib/sisu/v0/screen_text_color.rb | 2 | ||||
| -rw-r--r-- | lib/sisu/v0/share_src.rb | 2 | ||||
| -rw-r--r-- | lib/sisu/v0/sisupod_make.rb | 12 | ||||
| -rw-r--r-- | lib/sisu/v0/sysenv.rb | 303 | ||||
| -rw-r--r-- | lib/sisu/v0/texinfo.rb | 6 | ||||
| -rw-r--r-- | lib/sisu/v0/texpdf.rb | 6 | ||||
| -rw-r--r-- | lib/sisu/v0/texpdf_format.rb | 6 | ||||
| -rw-r--r-- | lib/sisu/v0/urls.rb | 6 | 
22 files changed, 239 insertions, 191 deletions
| @@ -33,11 +33,18 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.62.0.orig.tar.gz    * copy images associated with document along with document, does not take      care of skins though, for all images still need to use -CC +  * sysenv remote placement, and config, define multiple hosts for rsync or scp +    placement of output (one set of displayed urls associated with such output +    files) +    * special character exceptions, exception, fix (:code underscore angle bracket      issue)    * pruning +  * debian/control, added depends on rsync, used extensively (now also +    internally) +  %% sisu_0.61.0.orig.tar.gz (2007-10-12:41/5)  http://www.jus.uio.no/sisu/pkg/src/sisu_0.61.0.orig.tar.gz    3a2329726d49945247b1f4340482c895 1474630 sisu_0.61.0.orig.tar.gz diff --git a/conf/sisu/sisurc.yml b/conf/sisu/sisurc.yml index 611548b6..c135f270 100644 --- a/conf/sisu/sisurc.yml +++ b/conf/sisu/sisurc.yml @@ -70,9 +70,14 @@ default:    #language:     'English'  #% settings used by ssh scp  #remote: -#  user:         '[usrname]' -#  host:         '[remote.hostname]' -#  path:         '.' #no trailing slash eg 'sisu/www' +#  - +#    user:         '[usrname]' +#    host:         '[remote.hostname]' +#    path:         '.' #no trailing slash eg 'sisu/www' +#  - +#    user:         '[usrname]' +#    host:         '[remote.hostname]' +#    path:         '.' #no trailing slash eg 'sisu/www'  #% webrick information  #webrick:  #  port:         '8081' diff --git a/data/doc/sisu/sisu_markup_samples/sisu_manual/_sisu/sisurc.yml b/data/doc/sisu/sisu_markup_samples/sisu_manual/_sisu/sisurc.yml index 0948ffd6..18d562e3 100644 --- a/data/doc/sisu/sisu_markup_samples/sisu_manual/_sisu/sisurc.yml +++ b/data/doc/sisu/sisu_markup_samples/sisu_manual/_sisu/sisurc.yml @@ -73,9 +73,14 @@ default:    #language:     'English'  #% settings used by ssh scp rsync, requires keychain setup  #remote: -#  user:         '[provide_username]' -#  host:         '[provide_hostname]' -#  path:         '.' #no trailing slash eg 'sisu/www' +#  - +#    user:         '[provide_username]' +#    host:         '[provide_hostname]' +#    path:         '.' #no trailing slash eg 'sisu/www' +#  - +#    user:         '[provide_username]' +#    host:         '[provide_hostname]' +#    path:         '.' #no trailing slash eg 'sisu/www'  ##% webrick information  ##sql database info, postgresql and sqlite  #db: diff --git a/lib/sisu/v0/composite.rb b/lib/sisu/v0/composite.rb index 88c6c48a..4768522a 100644 --- a/lib/sisu/v0/composite.rb +++ b/lib/sisu/v0/composite.rb @@ -113,7 +113,7 @@ module SiSU_Assemble        end      end      def write(assembled) -      assembled_file=File.new("#{@env.path.composite_file}/#{@opt.fnb}._sst",'w+') +      assembled_file=File.new("#{@env.path.composite_file}/#{@opt.fnb}.ssm.sst",'w+')        assembled.each{|a| assembled_file << a }        assembled_file.close      end diff --git a/lib/sisu/v0/help.rb b/lib/sisu/v0/help.rb index 7c09da3c..e9f3906b 100644 --- a/lib/sisu/v0/help.rb +++ b/lib/sisu/v0/help.rb @@ -454,7 +454,7 @@ sisu    Note: page breaks are usually introduced to pdfs either as header instructions, indicating that pages should break at given levels    ------------------------------------------    #{@cX.cyan}Composite documents#{@cX.off} -    It is possible to build a document by creating a master document that requires other documents. The documents required may complete documents that could be generated independently, or they could be markup snippets, prepared so as to be easily available to be placed within another text. If the calling document is a master document (built mainly from other documents), it should be named with the suffix #{@cX.blue}.ssm#{@cX.off} Within this document you would provide information on the other documents that should be included within the text. These may be other documents that would be processed in a regular way, or markup bits prepared only for inclusion within a master document #{@cX.blue}.sst#{@cX.off} regular markup file, or #{@cX.blue}.ssi#{@cX.off} (insert/information) A secondary file of the composite document is built prior to processing with the same prefix and the suffix #{@cX.blue}._sst#{@cX.off} +    It is possible to build a document by creating a master document that requires other documents. The documents required may complete documents that could be generated independently, or they could be markup snippets, prepared so as to be easily available to be placed within another text. If the calling document is a master document (built mainly from other documents), it should be named with the suffix #{@cX.blue}.ssm#{@cX.off} Within this document you would provide information on the other documents that should be included within the text. These may be other documents that would be processed in a regular way, or markup bits prepared only for inclusion within a master document #{@cX.blue}.sst#{@cX.off} regular markup file, or #{@cX.blue}.ssi#{@cX.off} (insert/information) A secondary file of the composite document is built prior to processing with the same prefix and the suffix #{@cX.blue}.ssm.sst#{@cX.off}      #{@cX.cyan}#basic sisu markup alternatives#{@cX.off}        #{@cX.green}{#{@cX.off}filename.ssi#{@cX.green}}require#{@cX.off} diff --git a/lib/sisu/v0/html_format.rb b/lib/sisu/v0/html_format.rb index 090c779a..e770a339 100644 --- a/lib/sisu/v0/html_format.rb +++ b/lib/sisu/v0/html_format.rb @@ -198,7 +198,7 @@ module SiSU_HTML_Format  }      end      def scroll(text) -      if @md.fns =~ /\.[_-]?sst$/ +      if @md.fns =~ /\.(?:-|ssm\.)?sst$/          scroll=%{<td align="center" bgcolor=#{@vz.color_band2}>    <a href="#{@md.fn[:doc]}" target="_top" #{@vz.js_doc}>      #{text} diff --git a/lib/sisu/v0/hub.rb b/lib/sisu/v0/hub.rb index db0bb2a2..9fe102e7 100644 --- a/lib/sisu/v0/hub.rb +++ b/lib/sisu/v0/hub.rb @@ -129,23 +129,23 @@ module SiSU              pod_output(pod_name)              break            else -            put=fns.gsub(/(.+)?\._sst$/,'\1.ssm') +            put=fns.gsub(/(.+)?\.ssm\.sst$/,'\1.ssm')              @opt.fns=fns              if @req !~/(?:urls|remote)$/ -              if @req=~/^dal$/ and FileTest.file?(@opt.fns) and @opt.fns =~ /\.(?:[_-]?sst|ssm)$/ +              if @req=~/^dal$/ and FileTest.file?(@opt.fns) and @opt.fns =~ /\.(?:(?:-|ssm\.)?sst|ssm)$/                  if fns =~ /\.ssm$/; require "#{SiSU_lib}/composite"  #pre-processing                    SiSU_Assemble::Composite.new(@opt).read -                  @opt.fns=fns.gsub(/\.ssm$/,'._sst') +                  @opt.fns=fns.gsub(/\.ssm$/,'.ssm.sst')                  end                  SiSU_DAL::Source.new(@opt).read                                         # -m                elsif FileTest.file?(env.source_file_with_path)                  case @opt.fns -                when /\.(?:[_-]?sst|ssm)$/ +                when /\.(?:(?:-|ssm\.)?sst|ssm)$/                    case @req                    when /^dal$/                      if fns =~ /\.ssm$/; require "#{SiSU_lib}/composite"  #pre-processing                        SiSU_Assemble::Composite.new(@opt).read -                      @opt.fns=fns.gsub(/\.ssm$/,'._sst') +                      @opt.fns=fns.gsub(/\.ssm$/,'.ssm.sst')                      end                                              SiSU_DAL::Source.new(@opt).read             # -m                    when /^concordance$/;     SiSU_Concordance::Source.new(@opt).read     # -w @@ -196,7 +196,7 @@ module SiSU                @n_do=@n_do+1                tell=SiSU_Screen::Ansi.new(@opt.cmd,@n_do,"#{@req.upcase} processed")                tell.files_processed unless @opt.cmd =~/q/ -            else                       Operations.new(@opt).not_found +            else Operations.new(@opt).not_found              end            end          end @@ -409,7 +409,7 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/          end          if @opt.cmd=~/m/; op('dal','dal')                #% -m dal          end -        @opt.files=@opt.files.collect {|x| x=x.gsub(/\.ssm$/,'._sst') } +        @opt.files=@opt.files.collect {|x| x=x.gsub(/\.ssm$/,'.ssm.sst') }          if @opt.cmd =~/S/            op('sisupod_make','sisupod (zip)')                   #% -S make sisupod            if @opt.fns=~/\.kdi._sst/ @@ -447,7 +447,7 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/                when /\.(termsheet.rb)$/;            Operations.new(@opt).termsheet                else                                 #print "not processed --> ", fns, "\n"                end -            else                                   Operations.new(@opt).not_found +            else Operations.new(@opt).not_found              end            end            Operations.new.counter @@ -517,14 +517,14 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/        @opt.files.each do |fns|          if FileTest.file?(fns)            @opt.fns=fns -          unless @opt.fns =~ /(?:\.(?:[_-]?sst|ssm|ssp|sx[sdn]\.xml|termsheet.rb)|sisupod(?:\.zip)?)$/ +          unless @opt.fns =~ /(?:\.(?:(?:-|ssm\.)?sst|ssm|ssp|sx[sdn]\.xml|termsheet.rb)|sisupod(?:\.zip)?)$/              if @opt.fns=~/\.kdi$/ and @opt.mod.inspect =~/--(?:convert(?:-from)?|from)[=-]kdi/              elsif @opt.fns=~/\.sx[sdn]\.xml$/ and @opt.mod.inspect =~/--(?:(?:convert(?:-from)?|from)[=-])?(?:xml2sst|sxml)/              elsif @opt.fns=~/\.ssi$/ and @opt.mod.inspect =~/--identify/              else Operations.new(@opt).not_recognised              end            end -          if @opt.fns =~/\._sst$/ and @opt.cmd !~/[S_M]/ # rework necessry, revist, the _ flag is a hack, to keep ._sst files +          if @opt.fns =~/\.ssm\.sst$/ and @opt.cmd !~/[S_M]/ # rework necessry, revist, the _ flag is a hack, to keep ._sst files              @msg,@msgs='temporary file removed',nil              @tell.call.warn unless @opt.cmd =~/V/              File.unlink(@opt.fns) if File.exist?(@opt.fns) #CONSIDER diff --git a/lib/sisu/v0/manifest.rb b/lib/sisu/v0/manifest.rb index 8a1f0cd3..0776f4d1 100644 --- a/lib/sisu/v0/manifest.rb +++ b/lib/sisu/v0/manifest.rb @@ -234,8 +234,8 @@ module SiSU_Manifest          end        end        def source_tests -        if @md.fns =~/\._sst$/                                                  #% decide whether to extract and include requested/required documents -          req=@md.fns.gsub(/(.+)?\._sst$/,'\1.ssm.sst') #watch strange +        if @md.fns =~/\.ssm\.sst$/                                                  #% decide whether to extract and include requested/required documents +          req=@md.fns            if FileTest.file?("#@base_path_src/#{req}")==true              id,file='Markup Composite File (SiSU source)',req              summarize_source(id,file) diff --git a/lib/sisu/v0/manpage.rb b/lib/sisu/v0/manpage.rb index 8de98bde..397b94d8 100644 --- a/lib/sisu/v0/manpage.rb +++ b/lib/sisu/v0/manpage.rb @@ -70,7 +70,7 @@ module SiSU_manpage    class Source      def initialize(opt)        @opt=opt -      if @opt.fns =~/(.+?)\.[_-]?sst$/ +      if @opt.fns =~/(.+?)\.(?:-|ssm\.)?sst$/          @@dostype='unix endnotes'        else puts "#{sf} not a processed file type"        end diff --git a/lib/sisu/v0/odf.rb b/lib/sisu/v0/odf.rb index 4884c33a..feea7cde 100644 --- a/lib/sisu/v0/odf.rb +++ b/lib/sisu/v0/odf.rb @@ -224,7 +224,7 @@ module SiSU_ODF          %{#{breakpage}<text:h text:style-name="Heading_20_#{no}" text:outline-level="#{no}">#{para}</text:h>}        end        def image_src(i) -        image_source=if @md.fns =~/\._?ss[tm]$/ and FileTest.file?("#{@env.path.image_source_local_tex}/#{i}") +        image_source=if @md.fns =~/\.ss[tm]$/ and FileTest.file?("#{@env.path.image_source_local_tex}/#{i}") #review            @env.path.image_source_local_tex          elsif @md.fns =~/\.-ss[tm]$/ and FileTest.file?("#{@env.path.image_source_remote_tex}/#{i}")            @env.path.image_source_remote_tex diff --git a/lib/sisu/v0/options.rb b/lib/sisu/v0/options.rb index 7f94306e..a4cdc5e4 100644 --- a/lib/sisu/v0/options.rb +++ b/lib/sisu/v0/options.rb @@ -102,7 +102,7 @@ module SiSU_commandline            end            if x =~/^--\S+/;        m << x            end -        elsif x =~ /(?:\.(?:[_-]?sst(?:\.xml)?|ssm|ssi|sx[sdn]\.xml|s[1-3]|kdi|ssp)|sisupod(?:\.zip)?)$/ +        elsif x =~ /(?:\.(?:(?:-|ssm\.)?sst(?:\.xml)?|ssm|ssi|sx[sdn]\.xml|s[1-3]|kdi|ssp)|sisupod(?:\.zip)?)$/            if x =~/^(?:https?|file):\/\/\S+/;  f << x            elsif FileTest.file?(x); f << x            else  puts "file not found: #{x}" @@ -162,16 +162,16 @@ module SiSU_commandline      end      def fnb        unless fns.empty? -        fns[/(.+?)\.(?:[_-]?sst|ssm)$/,1] +        fns[/(.+?)\.(?:(?:-|ssm\.)?sst|ssm)$/,1]        end      end      def fnc -      @fnc=if @fns =~/\.(?:_sst|ssm)$/; fnb + '.ssm.sst' +      @fnc=if @fns =~/\.(?:ssm\.sst|ssm)$/; fnb + '.ssm.sst'        else @fns        end      end      def fncb -      @fncb=if @fns =~/(?:\~\S{2,3})?\.(?:_sst|ssm)$/; fnb + '.ssm.sst' +      @fncb=if @fns =~/(?:\~\S{2,3})?\.(?:ssm\.sst|ssm)$/; fnb + '.ssm.sst'        else @fns.gsub(/(?:\~\S{2,3})?(\.sst)$/,'\1')        end      end diff --git a/lib/sisu/v0/param.rb b/lib/sisu/v0/param.rb index e154b903..fec253d0 100644 --- a/lib/sisu/v0/param.rb +++ b/lib/sisu/v0/param.rb @@ -78,7 +78,7 @@ module SiSU_Param        @opt=opt        @cX||=SiSU_Screen::Ansi.new(opt.cmd)        @cmd,@mod=opt.cmd,opt.mod -      @fns=opt.fns.gsub(/\.ssm$/,'._sst') #revisit CHECK +      @fns=opt.fns.gsub(/\.ssm$/,'.ssm.sst') #revisit CHECK        Instantiate.new.param_instantiate        @env=SiSU_Env::Info_env.new(@fns)        @pstorefile="#{@env.path.dal}/#@fns.pstore" @@ -172,13 +172,13 @@ module SiSU_Param          # programs set here for things that affect output appearance only          @programs[:pdf]=SiSU_Env::System_call.new.program_found?('pdflatex')          if @env.i18n.multilingual -          m=/((.+?)(?:\~\w{2,3})?)\.([_-]?sst)$/ #watch added match for sss +          m=/((.+?)(?:\~\w{2,3})?)\.((?:-|ssm\.)?sst)$/ #watch added match for sss            @fnn,@fnb,@fnt=@fns[m,1],@fns[m,2],@fns[m,3]            @flv=@env.document_language_versions_found[:f] -          @fnz=if @fns =~/\.(?:_sst|ssm)$/; @fnn + '.ssm.zip' +          @fnz=if @fns =~/\.(?:ssm\.sst|ssm)$/; @fnn + '.ssm.zip'            else @fnn + '.sst.zip'            end -        else m=/(.+?)\.([_-]?sst)$/ +        else m=/(.+?)\.((?:-|ssm\.)?sst)$/            @fnb=@fnn=@fns[m,1]            @fnt=@fns[m,2]            @flv<<@fns @@ -190,7 +190,7 @@ module SiSU_Param          @sfx_src=@fns[m,2]          @sfx=nil          @flag_auto_heading_num=false -        if @fns =~ /[_-]?sst$/ #watch +        if @fns =~ /(?:-|ssm\.)?sst$/ #watch            @env_out_root=@env.path.output            @dir_out="#{@env.path.output}/#@fnb"            @dir_tex=@env.path.tex diff --git a/lib/sisu/v0/plaintext.rb b/lib/sisu/v0/plaintext.rb index d6284613..86a17089 100644 --- a/lib/sisu/v0/plaintext.rb +++ b/lib/sisu/v0/plaintext.rb @@ -70,7 +70,7 @@ module SiSU_Plaintext    class Source      def initialize(opt)        @opt=opt -       @@dostype=if @opt.fns =~/(.+?)\.[_-]?sst$/ +       @@dostype=if @opt.fns =~/(.+?)\.(?:-|ssm\.)?sst$/          if @opt.mod.inspect =~ /--footnote/ and @opt.mod.inspect =~ /--dos/;   'msdos footnotes'          elsif @opt.mod.inspect =~ /--endnote/ and @opt.mod.inspect =~ /--dos/; 'msdos endnotes'          elsif @opt.mod.inspect =~ /--footnote/;                                'unix footnotes' diff --git a/lib/sisu/v0/remote.rb b/lib/sisu/v0/remote.rb index 7e0205b1..2a45e3cb 100644 --- a/lib/sisu/v0/remote.rb +++ b/lib/sisu/v0/remote.rb @@ -62,8 +62,8 @@ module SiSU_Remote      def initialize(opt)        @opt=opt        @dir=SiSU_Env::Info_env.new(@opt.fns) -      @put=unless @opt.fns =~/\._sst$/; @opt.fns -      else @opt.fns.gsub(/(.+)?\._sst$/,'\1.ssm') +      @put=unless @opt.fns =~/\.ssm\.sst$/; @opt.fns +      else @opt.fns.gsub(/(.+)?\.ssm\.sst$/,'\1.ssm')        end        @remote=SiSU_Env::Info_remote.new(@opt)      end diff --git a/lib/sisu/v0/screen_text_color.rb b/lib/sisu/v0/screen_text_color.rb index 79656e07..a3f1cc7f 100644 --- a/lib/sisu/v0/screen_text_color.rb +++ b/lib/sisu/v0/screen_text_color.rb @@ -198,7 +198,7 @@ module SiSU_Screen        @sourcefilename=sourcefilename      end      def basename(sourcefilename) -      @basename=sourcefilename.sub(/\.(?:[_-]?sst|ssm)$/,'') +      @basename=sourcefilename.sub(/\.(?:(?:-|ssm\.)?sst|ssm)$/,'')      end      def sisu      end diff --git a/lib/sisu/v0/share_src.rb b/lib/sisu/v0/share_src.rb index 3d2bf8db..c098f282 100644 --- a/lib/sisu/v0/share_src.rb +++ b/lib/sisu/v0/share_src.rb @@ -79,7 +79,7 @@ module SiSU_Markup          unless @opt.fns =~/\.ssm$/; cp(@opt.fns,@output_path)          else            req=@opt.fns.gsub(/(.+?\.ssm)$/,'\1.sst') -          file="#{@env.path.composite_file}/#{@opt.fnb}._sst" +          file="#{@env.path.composite_file}/#{@opt.fnb}.ssm.sst"            if FileTest.file?(file);  cp(file,"#@output_path/#{req}")            else print "did not find #{file} to copy"            end diff --git a/lib/sisu/v0/sisupod_make.rb b/lib/sisu/v0/sisupod_make.rb index 10ec76e5..392aee7d 100644 --- a/lib/sisu/v0/sisupod_make.rb +++ b/lib/sisu/v0/sisupod_make.rb @@ -73,7 +73,7 @@ module SiSU_Doc        else                    ''        end        @local_path="#{@env.path.output}/src" #@local_path="#{@env.path.output}/#{@env.fnb}" -      @zipfile=if @opt.fns =~/\._sst$/; @opt.fns.gsub(/(?:\~\S{2,3})?\._sst$/,'.ssm') +      @zipfile=if @opt.fns =~/\.ssm\.sst$/; @opt.fns.gsub(/(?:\~\S{2,3})?\.ssm\.sst$/,'.ssm')        else @opt.fns.gsub(/(?:\~\S{2,3})?(\.sst)$/,'\1')        end        File.mkpath(pod_path) unless FileTest.directory?(pod_path) @@ -161,7 +161,7 @@ module SiSU_Doc        @rgx_image=/\{\s*(\S+?\.(?:png|jpg|gif))/        @rgx_skin=/^(?:@skin:|0~skin)\s+(\S+)/        @rgx_doc_import=/^%\s\s*\|(\S+?\.ss[ti])\|@\|\^\|>>ok/ -      use_file=if @opt.fns =~/(?:\.ssm|\._sst)$/; "#{@env.path.composite_file}/#{@opt.fnb}._sst" +      use_file=if @opt.fns =~/(?:\.ssm|\.ssm\.sst)$/; "#{@env.path.composite_file}/#{@opt.fnb}.ssm.sst"        else @opt.fns        end        file_array=IO.readlines(use_file,'') @@ -170,7 +170,7 @@ module SiSU_Doc          if f !~/^%\s/            skin << f.scan(@rgx_skin).uniq.flatten if f =~@rgx_skin            images << f.scan(@rgx_image).uniq if f =~@rgx_image -        elsif f =~/^%\s/ and @opt.fns =~/\._sst$/ +        elsif f =~/^%\s/ and @opt.fns =~/\.ssm\.sst$/            doc_import << f.scan(@rgx_doc_import).uniq if f =~@rgx_doc_import          end        end @@ -228,7 +228,7 @@ module SiSU_Doc          end        end        x=@env.document_language_versions_found   #check multiple document language versions (param not used) -      if doc_import.flatten.length > 0 and @opt.fns =~/\._sst$/ +      if doc_import.flatten.length > 0 and @opt.fns =~/\.ssm\.sst$/          doc_import.flatten.each do |f|            cp_r("#{@env.path.pwd}/#{f}","#{@env.path.processing}/sisupod/#{f}")          end @@ -237,8 +237,8 @@ module SiSU_Doc          x[:f].each do |f|            cp_r("#{@env.path.pwd}/#{f}","#{@env.path.processing}/sisupod/#{f}")          end -      elsif @opt.fns =~/\._sst/ -        ssm=@opt.fns.gsub(/\._sst/,'.ssm') +      elsif @opt.fns =~/\.ssm\.sst/ +        ssm=@opt.fns.gsub(/\.ssm\.sst/,'.ssm')          cp_r("#{@env.path.pwd}/#{ssm}","#{@env.path.processing}/sisupod/#{ssm}")        else cp_r("#{@env.path.pwd}/#{@opt.fns}","#{@env.path.processing}/sisupod/#{@opt.fns}")        end #NB not all possibilies met, revisit, also in case of composite file may wish to add README diff --git a/lib/sisu/v0/sysenv.rb b/lib/sisu/v0/sysenv.rb index 4252529d..510324c7 100644 --- a/lib/sisu/v0/sysenv.rb +++ b/lib/sisu/v0/sysenv.rb @@ -353,19 +353,19 @@ module SiSU_Env        end        if @fns and @fns != '' #watch          if multilingual -          m=/((.+?)(?:\~\w{2,3})?)\.([_-]?sst|ssm)$/ +          m=/((.+?)(?:\~\w{2,3})?)\.((?:-|ssm\.)?sst|ssm)$/            @@fnn ||=@fns[m,1]            @@fnb ||=@fns[m,2]            @@fnt ||=@fns[m,3]            @@flv ||=document_language_versions_found[:f] -          @@fnz ||=if @@fns =~/(?:\~\S{2,3})?\.(?:_sst|ssm)$/; @@fnb + '.ssm.zip' +          @@fnz ||=if @@fns =~/(?:\~\S{2,3})?\.(?:ssm\.sst|ssm)$/; @@fnb + '.ssm.zip'            else @@fnb + '.sst.zip'            end -        else m=/(.+?)\.([_-]?sst|ssm)$/ +        else m=/(.+?)\.((?:-|ssm\.)?sst|ssm)$/            @@fnb ||=@fns[m,1]            @@fnm ||=@fns[m,1]            @@fnt ||=@fns[m,2] -          @@fnz ||=if @@fns =~/(?:\~\S{2,3})?\.(?:_sst|ssm)$/; @@fnb + '.ssm.zip' +          @@fnz ||=if @@fns =~/(?:\~\S{2,3})?\.(?:ssm\.sst|ssm)$/; @@fnb + '.ssm.zip'            else @@fnb + '.sst.zip'            end          end @@ -381,9 +381,9 @@ module SiSU_Env        @fn={}        unless (@fns.nil? or @fns.empty?)          if multilingual -          m=/((.+?)(?:\~\w{2,3})?)\.([_-]?sst$)/ +          m=/((.+?)(?:\~\w{2,3})?)\.((?:-|ssm\.)?sst$)/            @fn[:b],@fn[:m],@fn[:t]=@fns[m,1],@fns[m,2],@fns[m,3] -        else m=/(.+?)\.([_-]?sst$)/ +        else m=/(.+?)\.((?:-|ssm\.)?sst$)/            @fn[:b]=@fn[:m]=@fns[m,1]            @fn[:t]=@fns[m,2]          end @@ -411,10 +411,10 @@ module SiSU_Env        @m=[]        unless (@fns.nil? or @fns.empty?)          if multilingual -          m=/((.+?)(?:\~\w{2,3})?)\.([_-]?sst$)/ +          m=/((.+?)(?:\~\w{2,3})?)\.((?:-|ssm\.)?sst$)/            @fn[:b],@fn[:m],@fn[:t]=@fns[m,1],@fns[m,2],@fns[m,3]            #@fl[:v]=@env.document_language_versions_found -        else m=/(.+?)\.([_-]?sst$)/ +        else m=/(.+?)\.((?:-|ssm\.)?sst$)/            @fn[:b]=@fn[:m]=@fns[m,1]            @fn[:t]=@fns[m,2]          end @@ -744,7 +744,7 @@ module SiSU_Env        language[:c]      end      def file_to_language(file) -      m=/.+?\~(\w{2,3})\.[_-]?sst$/ +      m=/.+?\~(\w{2,3})\.(?:-|ssm\.)?sst$/        @language=if file =~m ; file[m,1]        else ''        end @@ -767,7 +767,7 @@ module SiSU_Env        fnb=if @md and defined? @md.fnb; @md.fnb        elsif defined? @env.fnb and @env.fnb; @env.fnb        elsif not @fns.nil? and not @fns.empty? -        m=/(.+)?\.(?:[_-]?sst|ssm)$/m +        m=/(.+)?\.(?:(?:-|ssm\.)?sst|ssm)$/m          @fns[m,1] if not @fns.empty?        end        if fnb; @@fb ||=fnb @@ -1110,17 +1110,17 @@ WOK        self      end      def source_file_path -      file=@fns.gsub(/(\.ssm)/,'._sst') -      pth=unless file =~/\._sst$/; "#{Dir.pwd}" +      file=@fns.gsub(/\.ssm(?:\.sst)?/,'.ssm.sst') +      pth=unless file =~/\.ssm\.sst$/; "#{Dir.pwd}"        else "#{path.composite_file}"        end      end      def source_file_with_path -      file=@fns.gsub(/(\.ssm)/,'._sst') +      file=@fns.gsub(/\.ssm(?:\.sst)?/,'.ssm.sst')        "#{source_file_path}/#{file}"      end      def read_source_file(fns) -      fns_array=unless fns =~/\._sst$/ +      fns_array=unless fns =~/\.ssm.sst$/          IO.readlines(fns,'')        else IO.readlines("#{path.composite_file}/#{fns}",'')        end @@ -2004,23 +2004,38 @@ WOK        @rc=Get_init.instance.yamlrc      end      def remote_host #see Info_remote remote_host_base_general -      r={} -      r=if (defined? @rc['remote']['user'] and defined? @rc['remote']['host']) -        r[:user]=@rc['remote']['user'] -        r[:host]=@rc['remote']['host'] -        r[:path]=if defined? @rc['remote']['path'] +      r=[] +      r=if (defined? @rc['remote'] and @rc['remote'].class==Array) +        r_array=@rc['remote'] +        r_array.each_with_index do |renv,i| +          r[i]={} +          if defined? renv['user'] and defined? renv['host'] +          end +          r[i][:user]=renv['user'] +          r[i][:host]=renv['host'] +          r[i][:path]=if defined? renv['path'] +            renv['path'] +          else '' +          end +          r[i][:name]="#{r[i][:user]}@#{r[i][:host]}:#{r[i][:path]}" +        end +        r +      elsif (defined? @rc['remote'] and @rc['remote'].class==Hash and defined? @rc['remote']['user'] and defined? @rc['remote']['host']) +        r[0][:user]=@rc['remote']['user'] +        r[0][:host]=@rc['remote']['host'] +        r[0][:path]=if defined? @rc['remote']['path']            @rc['remote']['path']          else ''          end -        r[:name]="#{r[:user]}@#{r[:host]}:#{r[:path]}" +        r[0][:name]="#{r[:user]}@#{r[:host]}:#{r[:path]}"          r        else -        r[:name]='.' -        r[:user]='' -        r[:host]='' -        r[:path]='' -        r +        r[0][:name]='.' +        r[0][:user]='' +        r[0][:host]='' +        r[0][:path]=''          #puts "no remote host or user" +        r        end      end    end @@ -2036,138 +2051,154 @@ WOK        SiSU_Env::Info_remote_host.new.remote_host      end      def remote_host_base -      remote=remote_host_base_general -      #host_ip=IPSocket.getaddress(remote[:host]) unless remote[:host].empty? -      @@flag_remote=true if remote[:name] =~/\S+?@\S+/ #and  host_ip =~/\d+\.\d+\.\d+\.\d+/ #very naive check should be enough /[0-255]+\.[0-255]+\.[0-255]+\.[0-255]+/ -      remote_host_base_general[:name] +      remote_host_base_general.each do |remote_conn| +        #host_ip=IPSocket.getaddress(remote[:host]) unless remote[:host].empty? +        @@flag_remote=true if remote_conn[:name] =~/\S+?@\S+/ +        #remote_conn[:name] +      end +      remote_host_base_general      end      def scp                                                                    #sort out later using ruby libraries #not ideal, first time each file is sent, -r must be called separately for subdir to be built -      local=@source_path -      remote=case @opt.cmd -      when /u/;                "#{self.remote_host_base}/#{@env.path.stub_pwd}/."             #creates remote directory tree, this is not the usual function of u -      when /[abhHNopwxXy]/;    "#{self.remote_host_base}/#{@env.path.stub_pwd}/#{@fnb}/." -      else                     "#{self.remote_host_base}/#{@env.path.stub_pwd}/." -      end -      #remote="#{self.remote_host_base}/#{@env.path.stub_pwd}/." -      local_src=@source_path_src -      remote_src="#{self.remote_host_base}/#{@env.path.stub_src}/." -      src_txt=@opt.fnc -      src_pod=@opt.fncb.gsub(/(\.ss[mt])(?:\.sst)?$/,'\1.zip') -      if (local =~/\S/ and local !~/\/\//) and (remote =~/\S/ and remote !~/\/\//) and @@flag_remote==true and @opt.cmd !~/U/ -        System_call.new(local,remote).scp -        if FileTest.file?("#{local_src}/#{src_txt}") or FileTest.file?("#{local_src}/#{src_pod}") -          System_call.new("#{local_src}/#{src_txt} #{local_src}/#{src_pod}",remote_src).scp -        end -      elsif  @opt.cmd =~/U/ -        puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/ -        puts "#{local} -> #{remote}" -        if FileTest.file?("#{local_src}/#{src_doc}") or FileTest.file?("#{local_src}/#{src_doc}.zip") -          puts "#{local_src}/#{src_doc}* -> #{remote_src}" +      self.remote_host_base.each do |remote_conn| +        local_gen=@source_path +        remote_gen=case @opt.cmd +        when /u/;                "#{remote_conn[:name]}/#{@env.path.stub_pwd}/."             #creates remote directory tree, this is not the usual function of u +        when /[abhHNopwxXy]/;    "#{remote_conn[:name]}/#{@env.path.stub_pwd}/#{@fnb}/." +        else                     "#{remote_conn[:name]}/#{@env.path.stub_pwd}/." +        end +        #remote="#{remote_conn[:name]}/#{@env.path.stub_pwd}/." +        local_src=@source_path_src +        remote_src="#{remote_conn[:name]}/#{@env.path.stub_src}/." +        src_txt=@opt.fnc +        src_pod=@opt.fncb.gsub(/(\.ss[mt])(?:\.sst)?$/,'\1.zip') +        if (local_gen =~/\S/ and local_gen !~/\/\//) and (remote_gen =~/\S/ and remote_gen !~/\/\//) and @@flag_remote==true and @opt.cmd !~/U/ +          System_call.new(local_gen,remote_gen).scp +          if FileTest.file?("#{local_src}/#{src_txt}") or FileTest.file?("#{local_src}/#{src_pod}") +            System_call.new("#{local_src}/#{src_txt} #{local_src}/#{src_pod}",remote_src).scp +          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}.zip") +            puts "#{local_src}/#{src_doc}* -> #{remote_src}" +          end +        else +          puts 'suspect scp request, ignored' +          puts "#{local_gen} -> #{remote_gen} remote flag: #@@flag_remote" +          puts "permission not granted #{__FILE__} #{__LINE__}" if @opt.cmd =~/M/          end -      else -        puts 'suspect scp request, ignored' -        puts "#{local} -> #{remote} remote flag: #@@flag_remote" -        puts "permission not granted #{__FILE__} #{__LINE__}" if @opt.cmd =~/M/        end      end      def rsync -      local=@source_path -      remote="#{self.remote_host_base}/#{@env.path.stub_pwd}/." -      local_src=@source_path_src -      remote_src="#{self.remote_host_base}/#{@env.path.stub_src}/." -      src_txt=@opt.fnc -      src_pod=@opt.fncb.gsub(/(\.ss[mt])(?:\.sst)?$/,'\1.zip') -      if (local =~/\S/ and local !~/\/\//) and (remote =~/\S/ and remote !~/\/\//) and @@flag_remote==true and @opt.cmd !~/U/ -        System_call.new(local,remote,@opt.cmd).rsync('--delete-after') -        if FileTest.file?("#{local_src}/#{src_txt}") or FileTest.file?("#{local_src}/#{src_pod}") -          System_call.new("#{local_src}/#{src_txt} #{local_src}/#{src_pod}",remote_src,@opt.cmd).rsync -        end -      elsif  @opt.cmd =~/U/ -        puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/ -        puts "#{local} -> #{remote}" -        if FileTest.file?("#{local_src}/#{src_doc}") or FileTest.file?("#{local_src}/#{src_doc}.zip") -          puts "#{local_src}/#{src_doc}* -> #{remote_src}" +      self.remote_host_base.each do |remote_conn| +        local_gen=@source_path +        remote_gen="#{remote_conn[:name]}/#{@env.path.stub_pwd}/." +        local_src=@source_path_src +        remote_src="#{remote_conn[:name]}/#{@env.path.stub_src}/." +        src_txt=@opt.fnc +        src_pod=@opt.fncb.gsub(/(\.ss[mt])(?:\.sst)?$/,'\1.zip') +        if (local_gen =~/\S/ and local_gen !~/\/\//) and (remote_gen =~/\S/ and remote_gen !~/\/\//) and @@flag_remote==true and @opt.cmd !~/U/ +          System_call.new(local_gen,remote_gen,@opt.cmd).rsync('--delete-after') +          if FileTest.file?("#{local_src}/#{src_txt}") or FileTest.file?("#{local_src}/#{src_pod}") +            System_call.new("#{local_src}/#{src_txt} #{local_src}/#{src_pod}",remote_src,@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}.zip") +            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 -      else -        puts 'suspect rsync request, ignored' -        puts "#{local} -> #{remote} remote flag: #@@flag_remote" -        puts "permission not granted #{__FILE__} #{__LINE__}" if @opt.cmd =~/M/        end      end      def scp_base                                                                #base site -      local=@source_path -      remote="#{remote_host_base}/#{@env.path.stub_pwd}/." -      if defined? @rc['permission_set']['remote_base_site'] and @rc['permission_set']['remote_base_site'] and @@flag_remote==true and @opt.cmd !~/U/ -        puts "begin scp_base: #{local} -> #{remote}" -        System_call.new("#{local}/#{@env.path.style}/",remote).scp -      elsif @opt.cmd =~/U/ -        puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/ -        puts "begin scp_base: #{local} -> #{remote}" -        puts "#{local}/#{@env.path.style}/ -> #{remote}" -      else  puts "permission not granted #{__FILE__} #{__LINE__}" if @opt.cmd =~/M/ +      self.remote_host_base.each do |remote_conn| +        local=@source_path +        remote="#{remote_conn[:name]}/#{@env.path.stub_pwd}/." +        if defined? @rc['permission_set']['remote_base_site'] and @rc['permission_set']['remote_base_site'] and @@flag_remote==true and @opt.cmd !~/U/ +          puts "begin scp_base: #{local} -> #{remote}" +          System_call.new("#{local}/#{@env.path.style}/",remote).scp +        elsif @opt.cmd =~/U/ +          puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/ +          puts "begin scp_base: #{local} -> #{remote}" +          puts "#{local}/#{@env.path.style}/ -> #{remote}" +        else  puts "permission not granted #{__FILE__} #{__LINE__}" if @opt.cmd =~/M/ +        end        end      end      def scp_base_all                                                            #base site -      local=@source_path -      remote="#{remote_host_base}/#{@env.path.stub_pwd}/." -      if defined? @rc['permission_set']['remote_base_site'] and @rc['permission_set']['remote_base_site'] and @@flag_remote==true and @opt.cmd !~/U/ -        puts "begin scp_base_all: #{local} -> #{remote}" -        System_call.new("#{local}/_sisu/image_sys/",remote).scp -        System_call.new("#{local}/_sisu/image/",remote).scp -        System_call.new("#{local}/#{@env.path.style}/",remote).scp -      elsif @opt.cmd =~/U/ -        puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/ -        puts "scp_base_all: #{local} -> #{remote}" -        puts "#{local}/_sisu/image_sys/ -> #{remote}" -        puts "#{local}/_sisu/image/ -> #{remote}" -        puts "#{local}/#{@env.path.style}/ -> #{remote}" -      else  puts "permission not granted #{__FILE__} #{__LINE__}" if @opt.cmd =~/M/ +      self.remote_host_base.each do |remote_conn| +        local=@source_path +        remote="#{remote_conn[:name]}/#{@env.path.stub_pwd}/." +        if defined? @rc['permission_set']['remote_base_site'] and @rc['permission_set']['remote_base_site'] and @@flag_remote==true and @opt.cmd !~/U/ +          puts "begin scp_base_all: #{local} -> #{remote}" +          System_call.new("#{local}/_sisu/image/",remote).scp +          System_call.new("#{local}/_sisu/image_local/",remote).scp +          System_call.new("#{local}/#{@env.path.style}/",remote).scp +        elsif @opt.cmd =~/U/ +          puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/ +          puts "scp_base_all: #{local} -> #{remote}" +          puts "#{local}/_sisu/image/ -> #{remote}" +          puts "#{local}/_sisu/image_local/ -> #{remote}" +          puts "#{local}/#{@env.path.style}/ -> #{remote}" +        else  puts "permission not granted #{__FILE__} #{__LINE__}" if @opt.cmd =~/M/ +        end        end      end      def rsync_base                                                              #base site -      local=@source_path -      remote="#{remote_host_base}/#{@env.path.stub_pwd}/." -      if defined? @rc['permission_set']['remote_base_site'] and @rc['permission_set']['remote_base_site'] and @@flag_remote==true and @opt.cmd !~/U/ -        #puts "begin rsync_base: #{local} -> #{remote}" -        #System_call.new("#{local}/_sisu/image/",remote).rsync -        #System_call.new("#{local}/_sisu/image_local/",remote).rsync -        #System_call.new("#{local}/#{@env.path.style}/",remote).rsync -      elsif @opt.cmd =~/U/ -        puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/ -        puts "rsync_base: #{local} -> #{remote}" -        puts "#{local}/_sisu/image_sys/ -> #{remote}" -        puts "#{local}/_sisu/image/ -> #{remote}" -        puts "#{local}/#{@env.path.style}/ -> #{remote}" -      else  puts "permission not granted #{__FILE__} #{__LINE__}" if @opt.cmd =~/M/ +      self.remote_host_base.each do |remote_conn| +        local=@source_path +        remote="#{remote_conn[:name]}/#{@env.path.stub_pwd}/." +        if defined? @rc['permission_set']['remote_base_site'] and @rc['permission_set']['remote_base_site'] and @@flag_remote==true and @opt.cmd !~/U/ +          #puts "begin rsync_base: #{local} -> #{remote}" +          #System_call.new("#{local}/_sisu/image/",remote).rsync +          #System_call.new("#{local}/_sisu/image_local/",remote).rsync +          #System_call.new("#{local}/#{@env.path.style}/",remote).rsync +        elsif @opt.cmd =~/U/ +          puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/ +          puts "rsync_base: #{local} -> #{remote}" +          puts "#{local}/_sisu/image/ -> #{remote}" +          puts "#{local}/_sisu/image_local/ -> #{remote}" +          puts "#{local}/#{@env.path.style}/ -> #{remote}" +        else  puts "permission not granted #{__FILE__} #{__LINE__}" if @opt.cmd =~/M/ +        end        end      end      def rsync_base_sync                                                         #base site -      local=@source_path -      remote="#{remote_host_base}/#{@env.path.stub_pwd}/." -      if defined? @rc['permission_set']['remote_base_site'] and @rc['permission_set']['remote_base_site'] and @@flag_remote==true and @opt.cmd !~/U/ -        puts "begin rsync_base_sync: #{local} -> #{remote}" -        System_call.new("#{local}/_sisu/image_sys/",remote).rsync('--delete-after') -        System_call.new("#{local}/_sisu/image/",remote).rsync('--delete-after') -        System_call.new("#{local}/#{@env.path.style}/",remote).rsync('--delete-after') -      elsif @opt.cmd =~/U/ -        puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/ -        puts "rsync_base_sync: #{local} -> #{remote}" -        puts "#{local}/_sisu/image_sys/ -> #{remote}" -        puts "#{local}/_sisu/image/ -> #{remote}" -        puts "#{local}/#{@env.path.style}/ -> #{remote}" -      else  puts "permission not granted #{__FILE__} #{__LINE__}" if @opt.cmd =~/M/ +      self.remote_host_base.each do |remote_conn| +        local=@source_path +        remote="#{remote_conn[:name]}/#{@env.path.stub_pwd}/." +        if defined? @rc['permission_set']['remote_base_site'] and @rc['permission_set']['remote_base_site'] and @@flag_remote==true and @opt.cmd !~/U/ +          puts "begin rsync_base_sync: #{local} -> #{remote}" +          System_call.new("#{local}/_sisu/image/",remote).rsync('--delete-after') +          System_call.new("#{local}/_sisu/image_local/",remote).rsync('--delete-after') +          System_call.new("#{local}/#{@env.path.style}/",remote).rsync('--delete-after') +        elsif @opt.cmd =~/U/ +          puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/ +          puts "rsync_base_sync: #{local} -> #{remote}" +          puts "#{local}/_sisu/image/ -> #{remote}" +          puts "#{local}/_sisu/image_local/ -> #{remote}" +          puts "#{local}/#{@env.path.style}/ -> #{remote}" +        else  puts "permission not granted #{__FILE__} #{__LINE__}" if @opt.cmd =~/M/ +        end        end      end      def rsync_sitemaps                                                              #sitemap directory -      local="#@source_path/sitemapindex.xml" -      remote="#{remote_host_base}/#{@env.path.stub_pwd}/." -      if @@flag_remote -      #if defined? @rc['permission_set']['remote_base_site'] and @rc['permission_set']['remote_base_site'] #and @@flag_remote==true and @opt.cmd !~/U/ -        System_call.new(local,remote).rsync('--delete-after') -      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/ +      self.remote_host_base.each do |remote_conn| +        local="#@source_path/sitemapindex.xml" +        remote="#{remote_conn[:name]}/#{@env.path.stub_pwd}/." +        if @@flag_remote +        #if defined? @rc['permission_set']['remote_base_site'] and @rc['permission_set']['remote_base_site'] #and @@flag_remote==true and @opt.cmd !~/U/ +          System_call.new(local,remote).rsync('--delete-after') +        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 @@ -2209,7 +2240,7 @@ WOK        @fns=fns      end      def basefilename -      m=/(.+?)\.(?:[_-]?sst|ssm)$/m +      m=/(.+?)\.(?:(?:-|ssm\.)?sst|ssm)$/m        fnb=@fns[m,1]      end      def project diff --git a/lib/sisu/v0/texinfo.rb b/lib/sisu/v0/texinfo.rb index 3c7a35c2..a6d94c1a 100644 --- a/lib/sisu/v0/texinfo.rb +++ b/lib/sisu/v0/texinfo.rb @@ -84,7 +84,7 @@ module SiSU_TexInfo      def directories        begin          case @opt.fns -        when /\.[_-]?sst$/ +        when /\.(?:-|ssm\.)?sst$/            Dir.mkdir(@env.path.output) unless FileTest.directory?("#{@env.path.output}")            Dir.mkdir(@env.path.texi) unless FileTest.directory?(@env.path.tex)            @@filename_texinfo=File.new(%{#{@env.path.texi}/#{@opt.fnb}.texinfo},'w+') @@ -400,12 +400,12 @@ module SiSU_TexInfo        @@filename_texinfo.close      end      def makeinfo -      if @md.fns =~/\.[_-]?sst$/ +      if @md.fns =~/\.(?:-|ssm\.)?sst$/          m=/(.+?)\.([_-]?sst)$/.match(@md.fns)          fnb,sfx=m[1],m[2]          pwd=Dir.pwd          case sfx -        when /[_-]?sst$/ +        when /(?:-|ssm\.)?sst$/            @env=SiSU_Env::Info_env.new(@md.fns,@md.cmd)            Dir.chdir(@env.path.texi)            texinfo=SiSU_Env::System_call.new("#{fnb}.texinfo") diff --git a/lib/sisu/v0/texpdf.rb b/lib/sisu/v0/texpdf.rb index 4b4613b0..d6420684 100644 --- a/lib/sisu/v0/texpdf.rb +++ b/lib/sisu/v0/texpdf.rb @@ -91,7 +91,7 @@ module SiSU_TeX        begin          @dir_out_root=@env.path.output          case @opt.fns -        when /\.[_-]?sst$/ +        when /\.(?:-|ssm\.)?sst$/            SiSU_Env::SiSU_file.new(@md).mkdir            Dir.mkdir(@env.path.tex) unless FileTest.directory?(@env.path.tex)          end @@ -197,10 +197,10 @@ module SiSU_TeX            @tex_f_no=0            info={}            if FileTest.file?(@env.source_file_with_path) -            if @md.fns =~/\.[_-]?sst$/ +            if @md.fns =~/\.(?:-|ssm\.)?sst$/                @dirout=SiSU_Env::Info_env.new(@md.fns)                case @md.fns -              when /\.[_-]?sst$/ +              when /\.(?:-|ssm\.)?sst$/                  if FileTest.directory?(@env.path.tex)==true                    Dir.chdir(@env.path.tex)                    @dir_sisu=@dirout.path.output diff --git a/lib/sisu/v0/texpdf_format.rb b/lib/sisu/v0/texpdf_format.rb index 7798e886..7849727b 100644 --- a/lib/sisu/v0/texpdf_format.rb +++ b/lib/sisu/v0/texpdf_format.rb @@ -733,7 +733,7 @@ WOK        image,m=/<:image\s+(\S+)\s+.+?width=``(\d+)''.+?>/m.match(@string).captures        width=m[1] || '100'        width=width.to_i*0.4 -      image_source=if @md.fns =~/\._?sst$/ and FileTest.file?("#{dir.path.image_source_local_tex}/#{image}") +      image_source=if @md.fns =~/\.(?:ssm\.)?sst$/ and FileTest.file?("#{dir.path.image_source_local_tex}/#{image}")          dir.path.image_source_local_tex        elsif @md.fns =~/\.-ss[tm]$/ and FileTest.file?("#{dir.path.image_source_remote_tex}/#{image}")          dir.path.image_source_remote_tex @@ -770,7 +770,7 @@ WOK        hsp="\n{\\color{mywhite} .}&~\n" # ~ character for hardspace        caption="{\\\\\\\ \n\\begin{scriptsize}#{hsp*3}#{c}\\end{scriptsize}&}" if c        #caption="{\\\\\\\ \n\\begin{scriptsize}#{hsp*3}#{c[1]}\\end{scriptsize}&}" if c -      image_source=if @md.fns =~/\._?sst$/ and FileTest.file?("#{dir.path.image_source_local_tex}/#{image}") +      image_source=if @md.fns =~/\.(?:ssm\.)?sst$/ and FileTest.file?("#{dir.path.image_source_local_tex}/#{image}")          dir.path.image_source_local_tex        elsif @md.fns =~/\.-ss[tm]$/ and FileTest.file?("#{dir.path.image_source_remote_tex}/#{image}")          dir.path.image_source_remote_tex @@ -835,7 +835,7 @@ WOK              tell.print_grey #unless @opt.cmd =~/q/            end            ins=if image #most images fc etc. #% clean up ! -            out=if @md.fns =~/\._?sst$/ and FileTest.file?("#{dir.path.image_source_local_tex}/#{image}") +            out=if @md.fns =~/\.(?:ssm\.)?sst$/ and FileTest.file?("#{dir.path.image_source_local_tex}/#{image}")                @center_begin +                "\\\n\\href{#{url}}" + #not satisfactory: \\ added to ^line to mimic reference file output                "{\\includegraphics*[width=#{width}pt]" + diff --git a/lib/sisu/v0/urls.rb b/lib/sisu/v0/urls.rb index 1f9cfbe8..cfe242b3 100644 --- a/lib/sisu/v0/urls.rb +++ b/lib/sisu/v0/urls.rb @@ -86,7 +86,7 @@ module SiSU_urls        fn_set_lang=SiSU_Env::Standardise_language.new.file_to_language(@opt.fns)        @fnl=@env.i18n.lang_filename(fn_set_lang[:c])        @fn=SiSU_Env::Env_call.new(@opt.fns).lang(fn_set_lang[:c]) -      @m_regular=/(.+?)\.(?:[_-]?sst|ssm)$/ +      @m_regular=/(.+?)\.(?:(?:-|ssm\.)?sst|ssm)$/        @path=SiSU_Env::Info_env.new(@opt.fns)        @webserv_url=@path.url.output_tell        @tool=@env.program.text_editor @@ -97,7 +97,7 @@ module SiSU_urls        @odf_viewer=@env.program.odf_viewer        @manpage_gen=@env.program.manpage_generator        source=if @opt.fns =~/\.sst$/; @opt.fns -      elsif @opt.fns =~/\._sst/; "#@fnb.ssm.sst" +      elsif @opt.fns =~/\.ssm\.sst/; "#@fnb.ssm.sst"        else 'not recognised file'        end        @u ||= { @@ -217,7 +217,7 @@ module SiSU_urls              @opt.cmd.gsub!(/P[iu]/,'')            end            if x=~/^[sS]/ and @opt.cmd =~/[sS]/ -            zipfile=if @opt.fns =~/\._sst$/; y.gsub(/(?:\~\S{2,3})?(\._sst\.zip)$/,'.ssm.zip') +            zipfile=if @opt.fns =~/\.ssm\.sst$/; y.gsub(/(?:\~\S{2,3})?(\.ssm\.sst\.zip)$/,'.ssm.zip')              else y.gsub(/(?:\~\S{2,3})?(\.sst\.zip)$/,'\1')              end              tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#@browser #@webserv_url/src/#{y}") | 
