From 67533e4eb69e717533a5ca73440f644b9585bce4 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 22 Jul 2014 21:44:23 -0400 Subject: v5 v6: sysenv, revert to use of stub_pwd to correct hub post processing behavior * revert to use of stub_pwd (instead of preferred base_markup_dir_stub introduced in 5.5.1) to bring back correct hub (post) processing behavior --- data/doc/sisu/CHANGELOG_v5 | 2 ++ data/doc/sisu/CHANGELOG_v6 | 2 ++ lib/sisu/v5/se_info_env.rb | 46 +++++++++++++++++++++++++------------------ lib/sisu/v5/se_info_system.rb | 3 ++- lib/sisu/v6/se_info_env.rb | 46 +++++++++++++++++++++++++------------------ lib/sisu/v6/se_info_system.rb | 3 ++- 6 files changed, 62 insertions(+), 40 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5 index 8a42bb6a..839981e1 100644 --- a/data/doc/sisu/CHANGELOG_v5 +++ b/data/doc/sisu/CHANGELOG_v5 @@ -52,6 +52,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_5.5.2.orig.tar.xz * sysenv, * break up file, multiple se_* files + * revert to use of stub_pwd (instead of new base_markup_dir_stub introduced in + 5.5.1) to bring back correct hub (post) processing behavior %% 5.5.1.orig.tar.xz (2014-07-15:28/2) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_5.5.1 diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index 2014ec0c..8d0465b4 100644 --- a/data/doc/sisu/CHANGELOG_v6 +++ b/data/doc/sisu/CHANGELOG_v6 @@ -42,6 +42,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_6.1.2.orig.tar.xz * sysenv, * break up file, multiple se_* files + * revert to use of stub_pwd (instead of new base_markup_dir_stub introduced in + 6.1.1) to bring back correct hub (post) processing behavior %% 6.1.1.orig.tar.xz (2014-07-15:28/2) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_6.1.1 diff --git a/lib/sisu/v5/se_info_env.rb b/lib/sisu/v5/se_info_env.rb index 4b625d72..df3d0216 100644 --- a/lib/sisu/v5/se_info_env.rb +++ b/lib/sisu/v5/se_info_env.rb @@ -79,7 +79,7 @@ module SiSU_Info_Env rescue LoadError SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('pathname or fileutils NOT FOUND (LoadError)') end - attr_accessor :filename,:sys,:home,:hostname,:user,:env,:rc,:www,:fnb,:fnn,:fnt,:flv,:webserv_path,:base_markup_dir_stub,:stub_src,:webserv_host_cgi,:webserv_port_cgi,:processing,:processing_git,:etc,:yamlrc_dir + attr_accessor :filename,:sys,:home,:hostname,:user,:env,:rc,:www,:fnb,:fnn,:fnt,:flv,:webserv_path,:stub_pwd,:base_markup_dir_stub,:stub_src,:webserv_host_cgi,:webserv_port_cgi,:processing,:processing_git,:etc,:yamlrc_dir @@image_flag,@@local_image=true,true #warning on @@image_flag @@fb,@@man_path=nil,nil def initialize(fns='',md=nil) @@ -108,6 +108,8 @@ module SiSU_Info_Env @stub_src= @base_markup_dir_stub + '/src' @stub_pod= @base_markup_dir_stub + '/pod' @stub_epub= @base_markup_dir_stub + '/epub' + m=/.+\/(?:src\/)?(\S+)/m # m=/.+?\/(?:src\/)?([^\/]+)$/im # m=/.+\/(\S+)/m + @stub_pwd=@@pwd[m,1] || '' #; p __LINE__; #p @pwd; #p m; #p @stub_pwd pt=Pathname.new(Dir.pwd) stub=if output_dir_structure.by_language_code? r=Px[:lng_lst_rgx] @@ -189,6 +191,9 @@ module SiSU_Info_Env @@current_document||=Dir.pwd @@current_document end + def stub_pwd #200412 + @stub_pwd + end def base_markup_dir_stub @base_markup_dir_stub end @@ -1063,6 +1068,9 @@ WOK def pwd @sys.pwd end + def stub_pwd + @stub_pwd + end def base_markup_dir_stub @base_markup_dir_stub end @@ -1298,13 +1306,13 @@ WOK end def stub_dir (usr_dir?) \ - ? ("#{root_dir}/#{user}/#{base_markup_dir_stub}") - : ("#{root_dir}/#{base_markup_dir_stub}") # see defaults[:processing_path] + ? ("#{root_dir}/#{user}/#{stub_pwd}") + : ("#{root_dir}/#{stub_pwd}") # see defaults[:processing_path] end def stub_dir_orig # ends up with lang, if lang dir (usr_dir?) \ - ? ("#{root_dir}/#{user}/#{base_markup_dir_stub}") - : ("#{root_dir}/#{base_markup_dir_stub}") # see defaults[:processing_path] + ? ("#{root_dir}/#{user}/#{stub_pwd}") + : ("#{root_dir}/#{stub_pwd}") # see defaults[:processing_path] end def processing_sisupod(opt=nil) #processing directory, used/needed for sisu work files, has sub-directories (ao,tex etc) @opt=opt @@ -1542,21 +1550,21 @@ WOK "http://#{@sys.hostname}" end def dir_url - "file://#{path.webserv}/#{base_markup_dir_stub}" + "file://#{path.webserv}/#{stub_pwd}" end def localhost - "http://localhost/#{base_markup_dir_stub}" + "http://localhost/#{stub_pwd}" end def local - "http://#{hostname}/#{@base_markup_dir_stub}" + "http://#{hostname}/#{@stub_pwd}" end def root if defined? @rc['webserv']['url_root'] \ and @rc['webserv']['url_root'] =~/https?:\/\// - "#{@rc['webserv']['url_root']}/#{@base_markup_dir_stub}" + "#{@rc['webserv']['url_root']}/#{@stub_pwd}" elsif defined? @rc['webserv']['url_root'] \ and @rc['webserv']['url_root'] =~/localhost/ - "http://localhost/#{@base_markup_dir_stub}" + "http://localhost/#{@stub_pwd}" else "file://#{path.output}" end end @@ -1607,20 +1615,20 @@ WOK if port.webserv_port_cgi http + @rc['webserv_cgi']['host'] + ':' \ + port.webserv_port_cgi + '/' \ - + @base_markup_dir_stub + + @stub_pwd else http + @rc['webserv_cgi']['host'] + '/' \ - + @base_markup_dir_stub + + @stub_pwd end else http=((webserv_host_base=~/https?:\/\//) ? '' : 'http://') if port.webserv_port_cgi(opt) http + webserv_host_base + ':' \ + port.webserv_port_cgi(opt) + '/'\ - + @base_markup_dir_stub + + @stub_pwd else http + webserv_host_base + '/' \ - + @base_markup_dir_stub + + @stub_pwd end end http=http.strip @@ -1676,7 +1684,7 @@ WOK path.webserv + '/' \ + @base_markup_dir_stub. gsub(/#{path.webserv_dir}/, - "#{url.hostname}/#{@base_markup_dir_stub}") + "#{url.hostname}/#{@stub_pwd}") elsif defined? @rc['webserv']['webrick_url'] \ and @rc['webserv']['webrick_url']==false 'file://' + path.webserv @@ -1690,7 +1698,7 @@ WOK if path.webserv_dir \ and path.webserv =~ /#{path.webserv_dir}/ #revisit path.webserv + '/' \ - + @base_markup_dir_stub. + + @stub_pwd. gsub(/#{path.webserv_dir}/, "#{url.hostname}") elsif defined? @rc['webserv']['webrick_url'] \ @@ -1756,8 +1764,8 @@ WOK when /^filesystem(?:_url)?/ then url.dir_url when /^remote(?:_webserv)?/ then url.remote when /^(?:webserv|local_webserv)/ then url.local - when /^local(:\d+)/ then url.hostname + $1 + '/' + base_markup_dir_stub - when /^localhost(:\d+)/ then url.localhost + $1 + '/' + base_markup_dir_stub + when /^local(:\d+)/ then url.hostname + $1 + '/' + stub_pwd + when /^localhost(:\d+)/ then url.localhost + $1 + '/' + stub_pwd when /^localhost/ then url.localhost when /^webrick/ then url.webrick when /^path/ then url.webserv_map_pwd @@ -1791,7 +1799,7 @@ WOK if @@image_flag images=Dir.glob("#{image_external}/*.{png,jpg,gif}") pth=path.webserv + '/' \ - + @base_markup_dir_stub + + @stub_pwd FileUtils::mkdir_p("#{pth}/_sisu/image_external") \ unless FileTest.directory?("#{pth}/_sisu/image_external") images.each { |i| File.install(i,"#{pth}/#{i}") } \ diff --git a/lib/sisu/v5/se_info_system.rb b/lib/sisu/v5/se_info_system.rb index e932e264..7f0e7a00 100644 --- a/lib/sisu/v5/se_info_system.rb +++ b/lib/sisu/v5/se_info_system.rb @@ -76,10 +76,11 @@ module SiSU_Info_Sys_Gen share=Config::CONFIG['datadir'] + '/sisu' data=Config::CONFIG['datadir'] + '/doc/sisu' m=/.+\/(?:src\/)?(\S+)/m # m=/.+?\/(?:src\/)?([^\/]+)$/im # m=/.+\/(\S+)/m + @stub_pwd ||=@@pwd[m,1] @base_markup_dir_stub=SiSU_Utils::Path.new.base_markup_stub prcss_dir='_sisu_processing_' + '.' + SiSU_is[:version_dir] prcss_dir_tmp_root="/tmp/#{prcss_dir}" - prcss_dir_stub="#{prcss_dir}/#{@base_markup_dir_stub}" + prcss_dir_stub="#{prcss_dir}/#{@stub_pwd}" if @@user tmp_processing="#{prcss_dir_tmp_root}/#{@@user}/#{@base_markup_dir_stub}" tmp_processing_individual="#{prcss_dir_tmp_root}/#{@@user}/#{@base_markup_dir_stub}" diff --git a/lib/sisu/v6/se_info_env.rb b/lib/sisu/v6/se_info_env.rb index 17cdf3b3..a03c7d65 100644 --- a/lib/sisu/v6/se_info_env.rb +++ b/lib/sisu/v6/se_info_env.rb @@ -79,7 +79,7 @@ module SiSU_Info_Env rescue LoadError SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('pathname or fileutils NOT FOUND (LoadError)') end - attr_accessor :filename,:sys,:home,:hostname,:user,:env,:rc,:www,:fnb,:fnn,:fnt,:flv,:webserv_path,:base_markup_dir_stub,:stub_src,:webserv_host_cgi,:webserv_port_cgi,:processing,:processing_git,:etc,:yamlrc_dir + attr_accessor :filename,:sys,:home,:hostname,:user,:env,:rc,:www,:fnb,:fnn,:fnt,:flv,:webserv_path,:stub_pwd,:base_markup_dir_stub,:stub_src,:webserv_host_cgi,:webserv_port_cgi,:processing,:processing_git,:etc,:yamlrc_dir @@image_flag,@@local_image=true,true #warning on @@image_flag @@fb,@@man_path=nil,nil def initialize(fns='',md=nil) @@ -108,6 +108,8 @@ module SiSU_Info_Env @stub_src= @base_markup_dir_stub + '/src' @stub_pod= @base_markup_dir_stub + '/pod' @stub_epub= @base_markup_dir_stub + '/epub' + m=/.+\/(?:src\/)?(\S+)/m # m=/.+?\/(?:src\/)?([^\/]+)$/im # m=/.+\/(\S+)/m + @stub_pwd=@@pwd[m,1] || '' #; p __LINE__; #p @pwd; #p m; #p @stub_pwd pt=Pathname.new(Dir.pwd) stub=if output_dir_structure.by_language_code? r=Px[:lng_lst_rgx] @@ -189,6 +191,9 @@ module SiSU_Info_Env @@current_document||=Dir.pwd @@current_document end + def stub_pwd #200412 + @stub_pwd + end def base_markup_dir_stub @base_markup_dir_stub end @@ -1063,6 +1068,9 @@ WOK def pwd @sys.pwd end + def stub_pwd + @stub_pwd + end def base_markup_dir_stub @base_markup_dir_stub end @@ -1298,13 +1306,13 @@ WOK end def stub_dir (usr_dir?) \ - ? ("#{root_dir}/#{user}/#{base_markup_dir_stub}") - : ("#{root_dir}/#{base_markup_dir_stub}") # see defaults[:processing_path] + ? ("#{root_dir}/#{user}/#{stub_pwd}") + : ("#{root_dir}/#{stub_pwd}") # see defaults[:processing_path] end def stub_dir_orig # ends up with lang, if lang dir (usr_dir?) \ - ? ("#{root_dir}/#{user}/#{base_markup_dir_stub}") - : ("#{root_dir}/#{base_markup_dir_stub}") # see defaults[:processing_path] + ? ("#{root_dir}/#{user}/#{stub_pwd}") + : ("#{root_dir}/#{stub_pwd}") # see defaults[:processing_path] end def processing_sisupod(opt=nil) #processing directory, used/needed for sisu work files, has sub-directories (ao,tex etc) @opt=opt @@ -1542,21 +1550,21 @@ WOK "http://#{@sys.hostname}" end def dir_url - "file://#{path.webserv}/#{base_markup_dir_stub}" + "file://#{path.webserv}/#{stub_pwd}" end def localhost - "http://localhost/#{base_markup_dir_stub}" + "http://localhost/#{stub_pwd}" end def local - "http://#{hostname}/#{@base_markup_dir_stub}" + "http://#{hostname}/#{@stub_pwd}" end def root if defined? @rc['webserv']['url_root'] \ and @rc['webserv']['url_root'] =~/https?:\/\// - "#{@rc['webserv']['url_root']}/#{@base_markup_dir_stub}" + "#{@rc['webserv']['url_root']}/#{@stub_pwd}" elsif defined? @rc['webserv']['url_root'] \ and @rc['webserv']['url_root'] =~/localhost/ - "http://localhost/#{@base_markup_dir_stub}" + "http://localhost/#{@stub_pwd}" else "file://#{path.output}" end end @@ -1607,20 +1615,20 @@ WOK if port.webserv_port_cgi http + @rc['webserv_cgi']['host'] + ':' \ + port.webserv_port_cgi + '/' \ - + @base_markup_dir_stub + + @stub_pwd else http + @rc['webserv_cgi']['host'] + '/' \ - + @base_markup_dir_stub + + @stub_pwd end else http=((webserv_host_base=~/https?:\/\//) ? '' : 'http://') if port.webserv_port_cgi(opt) http + webserv_host_base + ':' \ + port.webserv_port_cgi(opt) + '/'\ - + @base_markup_dir_stub + + @stub_pwd else http + webserv_host_base + '/' \ - + @base_markup_dir_stub + + @stub_pwd end end http=http.strip @@ -1676,7 +1684,7 @@ WOK path.webserv + '/' \ + @base_markup_dir_stub. gsub(/#{path.webserv_dir}/, - "#{url.hostname}/#{@base_markup_dir_stub}") + "#{url.hostname}/#{@stub_pwd}") elsif defined? @rc['webserv']['webrick_url'] \ and @rc['webserv']['webrick_url']==false 'file://' + path.webserv @@ -1690,7 +1698,7 @@ WOK if path.webserv_dir \ and path.webserv =~ /#{path.webserv_dir}/ #revisit path.webserv + '/' \ - + @base_markup_dir_stub. + + @stub_pwd. gsub(/#{path.webserv_dir}/, "#{url.hostname}") elsif defined? @rc['webserv']['webrick_url'] \ @@ -1756,8 +1764,8 @@ WOK when /^filesystem(?:_url)?/ then url.dir_url when /^remote(?:_webserv)?/ then url.remote when /^(?:webserv|local_webserv)/ then url.local - when /^local(:\d+)/ then url.hostname + $1 + '/' + base_markup_dir_stub - when /^localhost(:\d+)/ then url.localhost + $1 + '/' + base_markup_dir_stub + when /^local(:\d+)/ then url.hostname + $1 + '/' + stub_pwd + when /^localhost(:\d+)/ then url.localhost + $1 + '/' + stub_pwd when /^localhost/ then url.localhost when /^webrick/ then url.webrick when /^path/ then url.webserv_map_pwd @@ -1791,7 +1799,7 @@ WOK if @@image_flag images=Dir.glob("#{image_external}/*.{png,jpg,gif}") pth=path.webserv + '/' \ - + @base_markup_dir_stub + + @stub_pwd FileUtils::mkdir_p("#{pth}/_sisu/image_external") \ unless FileTest.directory?("#{pth}/_sisu/image_external") images.each { |i| File.install(i,"#{pth}/#{i}") } \ diff --git a/lib/sisu/v6/se_info_system.rb b/lib/sisu/v6/se_info_system.rb index cb20d19b..6f290a4e 100644 --- a/lib/sisu/v6/se_info_system.rb +++ b/lib/sisu/v6/se_info_system.rb @@ -76,10 +76,11 @@ module SiSU_Info_Sys_Gen share=Config::CONFIG['datadir'] + '/sisu' data=Config::CONFIG['datadir'] + '/doc/sisu' m=/.+\/(?:src\/)?(\S+)/m # m=/.+?\/(?:src\/)?([^\/]+)$/im # m=/.+\/(\S+)/m + @stub_pwd ||=@@pwd[m,1] @base_markup_dir_stub=SiSU_Utils::Path.new.base_markup_stub prcss_dir='_sisu_processing_' + '.' + SiSU_is[:version_dir] prcss_dir_tmp_root="/tmp/#{prcss_dir}" - prcss_dir_stub="#{prcss_dir}/#{@base_markup_dir_stub}" + prcss_dir_stub="#{prcss_dir}/#{@stub_pwd}" if @@user tmp_processing="#{prcss_dir_tmp_root}/#{@@user}/#{@base_markup_dir_stub}" tmp_processing_individual="#{prcss_dir_tmp_root}/#{@@user}/#{@base_markup_dir_stub}" -- cgit v1.2.3