diff options
-rw-r--r-- | bin/sisu | 118 | ||||
-rw-r--r-- | data/doc/sisu/CHANGELOG_v4 | 16 | ||||
-rw-r--r-- | data/doc/sisu/CHANGELOG_v5 | 17 | ||||
-rw-r--r-- | data/sisu/v4/v/version.yml | 6 | ||||
-rw-r--r-- | data/sisu/v5/v/version.yml | 6 | ||||
-rw-r--r-- | lib/sisu/v4/constants.rb | 6 | ||||
-rw-r--r-- | lib/sisu/v4/shared_images.rb | 2 | ||||
-rw-r--r-- | lib/sisu/v4/sysenv.rb | 46 | ||||
-rw-r--r-- | lib/sisu/v5/constants.rb | 6 | ||||
-rw-r--r-- | lib/sisu/v5/shared_images.rb | 2 | ||||
-rw-r--r-- | lib/sisu/v5/sysenv.rb | 81 | ||||
-rw-r--r-- | rbuild | 6 |
12 files changed, 159 insertions, 153 deletions
@@ -4,70 +4,87 @@ begin def require_hub_path(sisu_path_specified_lib_) if sisu_path_specified_lib_ \ - && FileTest.file?("#{sisu_path_specified_lib_}/#{SiSU_lib}/hub.rb") - "#{sisu_path_specified_lib_}/#{SiSU_lib}" - else - SiSU_lib + && FileTest.file?("#{sisu_path_specified_lib_}/#{@sisu_lib}/hub.rb") + "#{sisu_path_specified_lib_}/#{@sisu_lib}" + else @sisu_lib + end + end + def select_version_check(instructions) + case instructions + when /"(?:--v4|--current|--stable)"/ then @version[:stable] + when /"(?:--v5|--next|--dev)"/ then @version[:unstable] + else @version[:default] end end #% sisu branch $VERBOSE=nil argv=$* - SiSU_called_from_directory=Dir.pwd - sisu_is_=:system_install + @sisu_called_from_directory=Dir.pwd require 'rubygems' - default_version=if __FILE__ =~/\/gems\// \ + @version={ + stable: 'v4', + unstable: 'v5', + } + @version[:default]=@version[:stable] + if $0 == __FILE__ \ + and File.dirname(__FILE__) != Config::CONFIG['bindir'] + sisu_run_from_= :full_path_to_sisu_bin_in_sisu_dir_tree + sisu_version_dir_=case $0 + when /\bsisu4$/ then @version[:stable] + when /\bsisu5$/ then @version[:unstable] + else select_version_check(argv.inspect) + end + elsif __FILE__ =~/\/gems\// \ and __FILE__ =~/\/sisu-[45]\.(?:\d+|[a-z])\.(?:\d+|[a-z])\// - sisu_is_=:gem_install + sisu_run_from_=:gem_install sisu_version_dir_=case __FILE__ - when /\/sisu-5\.(?:\d+|[a-z])\.(?:\d+|[a-z])\// then 'v5' - when /\/sisu-4\.(?:\d+|[a-z])\.(?:\d+|[a-z])\// then 'v4' - else 'v4' + when /\/sisu-4\.(?:\d+|[a-z])\.(?:\d+|[a-z])\// then @version[:stable] + when /\/sisu-5\.(?:\d+|[a-z])\.(?:\d+|[a-z])\// then @version[:unstable] + else @version[:default] end - else 'v4' - end - SiSU_is=sisu_is_ - sisu_version_dir_=case $0 - when /\bsisu4$/ then 'v4' - when /\bsisu5$/ then 'v5' else - case argv.inspect - when /"(?:--v4|--current|--stable)"/ then 'v4' - when /"(?:--v5|--next|--dev)"/ then 'v5' - else default_version + sisu_run_from_=:system_install + sisu_version_dir_=case $0 + when /\bsisu4$/ then @version[:stable] + when /\bsisu5$/ then @version[:unstable] + else select_version_check(argv.inspect) end end - SiSU_version_dir=sisu_version_dir_ #% $0 File.expand_path($0) - e=Config::CONFIG - sisu_path_base=if $0 =~ /^#{e['bindir']}\/sisu[45]?$/ - :system_default - elsif $0 !~ /^#{e['bindir']}\/sisu[45]?$/ \ + sisu_path_base=if sisu_run_from_ == :system_install \ + and $0 =~ /^#{Config::CONFIG['bindir']}\/sisu[45]?$/ + sisu_path_base_system_data=Config::CONFIG['datadir'] + '/sisu' + Config::CONFIG['datadir'] + '/sisu' # system install more widely distributed + elsif sisu_run_from_ == :full_path_to_sisu_bin_in_sisu_dir_tree \ + and $0 !~ /^#{Config::CONFIG['bindir']}\/sisu[45]?$/ \ && File.expand_path($0) =~/bin\/sisu[45]?$/ \ && FileTest.file?($0) + sisu_path_base_system_data=File.expand_path($0).sub(/\/bin\/sisu[45]?$/,'/data/sisu') File.expand_path($0).sub(/\/bin\/sisu[45]?$/,'') - else - nil + elsif sisu_run_from_==:gem_install + sisu_path_base_system_data=Gem::Specification.find_by_name("sisu").gem_dir + '/data/sisu' + Gem::Specification.find_by_name("sisu").gem_dir + else nil end - SiSU_lib="sisu/#{SiSU_version_dir}" - sisu_path_specified_lib_=($0 !~ /^#{e['bindir']}\/sisu[45]?$/) \ + @sisu_lib="sisu/#{sisu_version_dir_}" + sisu_path_specified_lib_=($0 !~ /^#{Config::CONFIG['bindir']}\/sisu[45]?$/) \ ? File.expand_path($0).sub(/bin\/sisu[45]?$/,'lib') : nil - SiSU_path_specified_Version_=if SiSU_is==:gem_install - Gem::Specification.find_by_name("sisu").gem_dir + "/data/sisu/#{SiSU_version_dir}/v/version.yml" - elsif sisu_path_specified_lib_ \ - and sisu_path_base - "#{sisu_path_base}/data/sisu/#{SiSU_version_dir}/v/version.yml" - elsif sisu_path_base - Config::CONFIG['datadir'] + '/sisu' + "/#{SiSU_version_dir}/v/version.yml" - else nil - end - SiSU_path_base=sisu_path_base - SiSU_path_lib="#{require_hub_path(sisu_path_specified_lib_)}" + sisu_version_info_path_="#{sisu_path_base_system_data}/#{sisu_version_dir_}/v/version.yml" + sisu_path_lib="#{require_hub_path(sisu_path_specified_lib_)}" + lng_lst_ = %w[am bg bn br ca cs cy da de el en eo es et eu fi fr ga gl he hi hr hy ia is it ja ko la lo lt lv ml mr nl nn no oc pl pt pt_BR ro ru sa se sk sl sq sr sv ta te th tk tr uk ur us vi zh] + SiSU_is={ + run_from: sisu_run_from_, + version_dir: sisu_version_dir_, + path_base: sisu_path_base, + path_base_system_data: sisu_path_base_system_data, + path_lib: sisu_path_lib, + version_info_path: sisu_version_info_path_, + language_list: lng_lst_, + } #% $* - require "#{SiSU_path_lib}/hub" - lng_lst = %w[am bg bn br ca cs cy da de el en eo es et eu fi fr ga gl he hi hr hy ia is it ja ko la lo lt lv ml mr nl nn no oc pl pt pt_BR ro ru sa se sk sl sq sr sv ta te th tk tr uk ur us vi zh] - lng_lst_rgx=lng_lst.join('|') + require "#{SiSU_is[:path_lib]}/hub" + lng_lst_rgx=SiSU_is[:language_list].join('|') argv_sub_files={} argv_sub_mods=[] argv.each do |x| @@ -97,8 +114,8 @@ begin Dir.chdir(markup_dir) $sisu_document_markup_directory_base_fixed_path=Dir.pwd.gsub(/\/(?:#{lng_lst_rgx})$/,'') SiSU::HubMaster.new(argv_sub) - Dir.chdir(SiSU_called_from_directory) - system("cd #{SiSU_called_from_directory}") + Dir.chdir(@sisu_called_from_directory) + system("cd #{@sisu_called_from_directory}") elsif markup_dir =~/https?:/ markup_file.each do |mf| (FileTest.file?(mf)) \ @@ -122,14 +139,13 @@ rescue STDERR.puts $@ require 'rbconfig' require 'rubygems' - e=Config::CONFIG puts %{ #{%x{ruby -v}.strip.to_s} #{RUBY_VERSION} - ruby version: #{e['RUBY_PROGRAM_VERSION']}p#{e['PATCHLEVEL']} - ruby named: #{e['ruby_version']} - rubylib: #{e['rubylibdir']} - rubylib local: #{e['sitelibdir']} + ruby version: #{Config::CONFIG['RUBY_PROGRAM_VERSION']}p#{Config::CONFIG['PATCHLEVEL']} + ruby named: #{Config::CONFIG['ruby_version']} + rubylib: #{Config::CONFIG['rubylibdir']} + rubylib local: #{Config::CONFIG['sitelibdir']} gem dir: #{Gem.dir} gem path: #{Gem.path} } diff --git a/data/doc/sisu/CHANGELOG_v4 b/data/doc/sisu/CHANGELOG_v4 index 26a3c700..c3a3cf80 100644 --- a/data/doc/sisu/CHANGELOG_v4 +++ b/data/doc/sisu/CHANGELOG_v4 @@ -5,6 +5,8 @@ <http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=blob_plain;f=debian/changelog;hb=refs/heads/debian/sid> v5 development branch v4 stable branch supersedes & replaces v3 branch + [v4 branch closure imminent, v5 to become stable, posted with 4.2.20, + 2014-01-20] initial goals: * remove/retire "skins"; replace some functionality with headers and/or yml file (consider header like syntax for document and site appearance info) @@ -23,6 +25,20 @@ v2 branch is removed; it is available in sisu =< 3.3.2 %% Reverse Chronological: +%% 4.2.20.orig.tar.xz (2014-01-20:03/1) +http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_4.2.20 +http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/debian/sisu_4.2.20-1 +http://www.jus.uio.no/sisu/pkg/src/sisu_4.2.20.orig.tar.xz + sisu_4.2.20.orig.tar.xz + sisu_4.2.20-1.dsc + +[good time to consider rollover: closing v4 branch, replacing it with v5 & +introducing v6 for development, proposed for this release + 1] + +* bin/sisu & some related lib changes + +* sysenv for texpdf, fix for when tex to pdf generator is absent + %% 4.2.19.orig.tar.xz (2014-01-17:02/5) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_4.2.19 http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/debian/sisu_4.2.19-1 diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5 index 9cabec20..5eff6d0c 100644 --- a/data/doc/sisu/CHANGELOG_v5 +++ b/data/doc/sisu/CHANGELOG_v5 @@ -4,10 +4,13 @@ * debian/changelog <http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=blob_plain;f=debian/changelog;hb=refs/heads/debian/sid> v5 markup rule change, document structure rule introduced: + [v5 branch to become stable shortly, posted with 5.2.3, 2014-01-20] * single document root == document title == heading level A~ * adds possible level D~ (from 5.2 on (earlier v5 development branch insulated from v4)) v4 stable branch supersedes & replaces v3 branch + [v4 branch closure imminent, v5 to become stable, posted with 4.2.20, + 2014-01-20] initial goals: * remove/retire "skins"; replace some functionality with headers and/or yml file (consider header like syntax for document and site appearance info) @@ -26,6 +29,20 @@ v2 branch is removed; it is available in sisu =< 3.3.2 %% Reverse Chronological: +%% 5.2.3.orig.tar.xz (2014-01-20:03/1) +http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_5.2.3 +http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/debian/sisu_5.2.3-1 +http://www.jus.uio.no/sisu/pkg/src/sisu_5.2.3.orig.tar.xz + sisu_5.2.3.orig.tar.xz + sisu_5.2.3-1.dsc + +[good time to consider rollover: closing v4 branch, replacing it with v5 & +introducing v6 for development, proposed for this release + 1] + +* bin/sisu & some related lib changes + +* sysenv for texpdf, fix for when tex to pdf generator is absent + %% 5.2.2.orig.tar.xz (2014-01-17:02/5) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_5.2.2 http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/debian/sisu_5.2.2-1 diff --git a/data/sisu/v4/v/version.yml b/data/sisu/v4/v/version.yml index faa3d64c..41bffc8e 100644 --- a/data/sisu/v4/v/version.yml +++ b/data/sisu/v4/v/version.yml @@ -1,5 +1,5 @@ --- :project: SiSU -:version: 4.2.19 -:date_stamp: 2014w02/5 -:date: "2014-01-17" +:version: 4.2.20 +:date_stamp: 2014w03/1 +:date: "2014-01-20" diff --git a/data/sisu/v5/v/version.yml b/data/sisu/v5/v/version.yml index 073b83d3..de7e0305 100644 --- a/data/sisu/v5/v/version.yml +++ b/data/sisu/v5/v/version.yml @@ -1,5 +1,5 @@ --- :project: SiSU -:version: 5.2.2 -:date_stamp: 2014w02/5 -:date: "2014-01-17" +:version: 5.2.3 +:date_stamp: 2014w03/1 +:date: "2014-01-20" diff --git a/lib/sisu/v4/constants.rb b/lib/sisu/v4/constants.rb index f95b1dbd..bb90cdc8 100644 --- a/lib/sisu/v4/constants.rb +++ b/lib/sisu/v4/constants.rb @@ -210,7 +210,7 @@ Px={ po_subscript_o: ',{', po_subscript_c: '},', po_hilite_o: '*{', po_hilite_c: '}*', po_monospace_o: '#{', po_monospace_c: '}#', - lng_lst: %w[am bg bn br ca cs cy da de el en eo es et eu fi fr ga gl he hi hr hy ia is it ja ko la lo lt lv ml mr nl nn no oc pl pt pt_BR ro ru sa se sk sl sq sr sv ta te th tk tr uk ur us vi zh], + lng_lst: SiSU_is[:language_list], lv1: '*', lv2: '=', lv3: '=', @@ -239,8 +239,8 @@ else } end Db={ - name_prefix: "SiSU#{SiSU_version_dir}a_", - name_prefix_db: "sisu_#{SiSU_version_dir}a_", + name_prefix: "SiSU#{SiSU_is[:version_dir]}a_", + name_prefix_db: "sisu_#{SiSU_is[:version_dir]}a_", col_title: 800, col_title_part: 400, col_title_edition: 10, diff --git a/lib/sisu/v4/shared_images.rb b/lib/sisu/v4/shared_images.rb index ffcf880f..92f0c894 100644 --- a/lib/sisu/v4/shared_images.rb +++ b/lib/sisu/v4/shared_images.rb @@ -129,7 +129,7 @@ module SiSU_Images end def select_sisu_base images=%w[arrow_next_red.png arrow_prev_red.png arrow_up_red.png dot_clear.png dot_white.png b_doc.png b_epub.png b_odf.png b_pdf.png b_toc.png] - src_path="#{@env.path.share}/image" + src_path="#{SiSU_is[:path_base_system_data]}/image" dest=dest_path(:image_sys) copy(src_path,dest,images) end diff --git a/lib/sisu/v4/sysenv.rb b/lib/sisu/v4/sysenv.rb index 341a29f7..eda1ad46 100644 --- a/lib/sisu/v4/sysenv.rb +++ b/lib/sisu/v4/sysenv.rb @@ -104,7 +104,7 @@ module SiSU_Env data=Config::CONFIG['datadir'] + '/doc/sisu' m=/.+\/(?:src\/)?(\S+)/m # m=/.+?\/(?:src\/)?([^\/]+)$/im # m=/.+\/(\S+)/m @stub_pwd ||=@@pwd[m,1] - prcss_dir='_sisu_processing_' + '.' + SiSU_version_dir + prcss_dir='_sisu_processing_' + '.' + SiSU_is[:version_dir] prcss_dir_tmp_root="/tmp/#{prcss_dir}" prcss_dir_stub="#{prcss_dir}/#{@stub_pwd}" if @@user @@ -282,13 +282,13 @@ module SiSU_Env end def rc_path_options [ - "#{$sisu_document_markup_directory_base_fixed_path}/.sisu/#{SiSU_version_dir}", + "#{$sisu_document_markup_directory_base_fixed_path}/.sisu/#{SiSU_is[:version_dir]}", "#{$sisu_document_markup_directory_base_fixed_path}/.sisu", - "#{$sisu_document_markup_directory_base_fixed_path}/_sisu/#{SiSU_version_dir}", + "#{$sisu_document_markup_directory_base_fixed_path}/_sisu/#{SiSU_is[:version_dir]}", "#{$sisu_document_markup_directory_base_fixed_path}/_sisu", - "#{@@home}/.sisu/#{SiSU_version_dir}", + "#{@@home}/.sisu/#{SiSU_is[:version_dir]}", "#{@@home}/.sisu", - "#{@@sisu_etc}/#{SiSU_version_dir}", + "#{@@sisu_etc}/#{SiSU_is[:version_dir]}", "#{@@sisu_etc}", ] end @@ -359,13 +359,13 @@ module SiSU_Env tell_no_yaml='WARNING - YAML loading switched off, to enable delete the file:' if @markup_dir_changed_ @ad_path=[ - "#{$sisu_document_markup_directory_base_fixed_path}/.sisu/#{SiSU_version_dir}/skin/yml", + "#{$sisu_document_markup_directory_base_fixed_path}/.sisu/#{SiSU_is[:version_dir]}/skin/yml", "#{$sisu_document_markup_directory_base_fixed_path}/.sisu/skin/yml", - "#{$sisu_document_markup_directory_base_fixed_path}/_sisu/#{SiSU_version_dir}/skin/yml", + "#{$sisu_document_markup_directory_base_fixed_path}/_sisu/#{SiSU_is[:version_dir]}/skin/yml", "#{$sisu_document_markup_directory_base_fixed_path}/_sisu/skin/yml", - "#{@@home}/.sisu/#{SiSU_version_dir}/skin/yml", + "#{@@home}/.sisu/#{SiSU_is[:version_dir]}/skin/yml", "#{@@home}/.sisu/skin/yml", - "#{@@sisu_etc}/#{SiSU_version_dir}/skin/yml", + "#{@@sisu_etc}/#{SiSU_is[:version_dir]}/skin/yml", "#{@@sisu_etc}/skin/yml", ] @ad_path.each do |v| @@ -822,11 +822,11 @@ module SiSU_Env : (STDERR.puts "\t*WARN* #{program} is not installed #{program_ref}") end def tex2pdf_engine - prog=['xetex','xelatex','pdflatex','pdfetex','pdftex'] + progs=['xetex','xelatex','pdflatex','pdfetex','pdftex'] @pdfetex_flag=false @cmd ||='' @texpdf=nil - prog.each do |program| + progs.each do |program| if program_found?(program) @texpdf=program if program =~/xetex|xelatex|pdftex|pdflatex/ @pdfetex_flag=true @@ -834,7 +834,7 @@ module SiSU_Env end end if @pdfetex_flag==false - @texpdf=prog.join(', ') + @texpdf=progs.join(', ') end @texpdf end @@ -846,7 +846,6 @@ module SiSU_Env else %q{2>&1 | grep -v '$'} end mode='batchmode' #mode='nonstopmode' - program_ref="\n\t\tSee http://www.tug.org/applications/pdftex/\n\t\tOn Debian this is is included in tetex-extra" texpdf=tex2pdf_engine if @pdfetex_flag texpdf_cmd=case texpdf @@ -860,7 +859,7 @@ module SiSU_Env "#{texpdf} -interaction=#{mode} #{@input} #{tell}\n" end system(texpdf_cmd) - else STDERR.puts "\t*WARN* none of the following programs are installed: #{program[0]}, #{program[1]}, #{program[2]} is installed. #{program_ref}" + else STDERR.puts "\t*WARN* none of the following programs are installed: #{@texpdf}" end end def makeinfo #texinfo @@ -2849,7 +2848,7 @@ WOK def odf_structure FileUtils::rm_rf(processing_path.processing_path.odf_pth) FileUtils::mkdir_p(processing_path.processing_path.odf_pth) - system("unzip -q #{path.share}/#{SiSU_version_dir}/odf/odt.zip -d #{processing_path.odf_pth}") + system("unzip -q #{path.share}/#{SiSU_is[:version_dir]}/odf/odt.zip -d #{processing_path.odf_pth}") end def sisupod_gen(fns_pod) sisupod_gen_v3(fns_pod) @@ -3591,18 +3590,18 @@ WOK def get_version @version={} @pwd=ENV['PWD'] - yst_ver=SiSU_path_specified_Version_ \ - ? SiSU_path_specified_Version_ - : "#{defaults[:sisu_share]}/#{SiSU_version_dir}/v/version.yml" + yst_ver=SiSU_is[:version_info_path] \ + ? SiSU_is[:version_info_path] + : "#{defaults[:sisu_share]}/#{SiSU_is[:version_dir]}/v/version.yml" lib_path=@@lib_path ? @@lib_path : `echo $RUBYLIB`.split(':') @@lib_path ||=lib_path if File.exist?(yst_ver) @version=YAML::load(File::open(yst_ver)) #unless @@noyaml end - @version[:install_method]=if SiSU_is==:gem_install + @version[:install_method]=if SiSU_is[:run_from]==:gem_install spec = Gem::Specification.find_by_name("sisu") gem_root = spec.gem_dir - (File.dirname(__FILE__.gsub(/\/lib\/sisu\/#{SiSU_version_dir}/,'')) == gem_root) \ + (File.dirname(__FILE__.gsub(/\/lib\/sisu\/#{SiSU_is[:version_dir]}/,'')) == gem_root) \ ? ' (ruby gem install)' : '' else '' end @@ -6322,12 +6321,7 @@ WOK cp_images(src,dest) if FileTest.directory?(src) end def cp_base_images #fix images - src=if SiSU_path_base == :system_default \ - or SiSU_path_base == nil - @env.path.share + '/image' - else - SiSU_path_base + '/data/sisu/image' - end + src=SiSU_is[:path_base_system_data] + '/image' dest_arr=[ "#{@env.path.webserv}/_sisu/image_sys", "#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/image_sys" diff --git a/lib/sisu/v5/constants.rb b/lib/sisu/v5/constants.rb index 04c0358a..e84c0901 100644 --- a/lib/sisu/v5/constants.rb +++ b/lib/sisu/v5/constants.rb @@ -224,7 +224,7 @@ Px={ po_subscript_o: ',{', po_subscript_c: '},', po_hilite_o: '*{', po_hilite_c: '}*', po_monospace_o: '#{', po_monospace_c: '}#', - lng_lst: %w[am bg bn br ca cs cy da de el en eo es et eu fi fr ga gl he hi hr hy ia is it ja ko la lo lt lv ml mr nl nn no oc pl pt pt_BR ro ru sa se sk sl sq sr sv ta te th tk tr uk ur us vi zh], + lng_lst: SiSU_is[:language_list], lv1: '*', lv2: '=', lv3: '=', @@ -253,8 +253,8 @@ else } end Db={ - name_prefix: "SiSU#{SiSU_version_dir}a_", - name_prefix_db: "sisu_#{SiSU_version_dir}a_", + name_prefix: "SiSU#{SiSU_is[:version_dir]}a_", + name_prefix_db: "sisu_#{SiSU_is[:version_dir]}a_", col_title: 800, col_title_part: 400, col_title_edition: 10, diff --git a/lib/sisu/v5/shared_images.rb b/lib/sisu/v5/shared_images.rb index b3d3f4fb..e307eba3 100644 --- a/lib/sisu/v5/shared_images.rb +++ b/lib/sisu/v5/shared_images.rb @@ -130,7 +130,7 @@ module SiSU_Images end def select_sisu_base images=%w[arrow_next_red.png arrow_prev_red.png arrow_up_red.png dot_clear.png dot_white.png b_doc.png b_epub.png b_odf.png b_pdf.png b_toc.png] - src_path="#{@env.path.share}/image" + src_path="#{SiSU_is[:path_base_system_data]}/image" dest=dest_path(:image_sys) copy(src_path,dest,images) end diff --git a/lib/sisu/v5/sysenv.rb b/lib/sisu/v5/sysenv.rb index e04882d7..a8fcbd7a 100644 --- a/lib/sisu/v5/sysenv.rb +++ b/lib/sisu/v5/sysenv.rb @@ -105,7 +105,7 @@ module SiSU_Env data=Config::CONFIG['datadir'] + '/doc/sisu' m=/.+\/(?:src\/)?(\S+)/m # m=/.+?\/(?:src\/)?([^\/]+)$/im # m=/.+\/(\S+)/m @stub_pwd ||=@@pwd[m,1] - prcss_dir='_sisu_processing_' + '.' + SiSU_version_dir + prcss_dir='_sisu_processing_' + '.' + SiSU_is[:version_dir] prcss_dir_tmp_root="/tmp/#{prcss_dir}" prcss_dir_stub="#{prcss_dir}/#{@stub_pwd}" if @@user @@ -283,13 +283,13 @@ module SiSU_Env end def rc_path_options [ - "#{$sisu_document_markup_directory_base_fixed_path}/.sisu/#{SiSU_version_dir}", + "#{$sisu_document_markup_directory_base_fixed_path}/.sisu/#{SiSU_is[:version_dir]}", "#{$sisu_document_markup_directory_base_fixed_path}/.sisu", - "#{$sisu_document_markup_directory_base_fixed_path}/_sisu/#{SiSU_version_dir}", + "#{$sisu_document_markup_directory_base_fixed_path}/_sisu/#{SiSU_is[:version_dir]}", "#{$sisu_document_markup_directory_base_fixed_path}/_sisu", - "#{@@home}/.sisu/#{SiSU_version_dir}", + "#{@@home}/.sisu/#{SiSU_is[:version_dir]}", "#{@@home}/.sisu", - "#{@@sisu_etc}/#{SiSU_version_dir}", + "#{@@sisu_etc}/#{SiSU_is[:version_dir]}", "#{@@sisu_etc}", ] end @@ -360,13 +360,13 @@ module SiSU_Env tell_no_yaml='WARNING - YAML loading switched off, to enable delete the file:' if @markup_dir_changed_ @ad_path=[ - "#{$sisu_document_markup_directory_base_fixed_path}/.sisu/#{SiSU_version_dir}/skin/yml", + "#{$sisu_document_markup_directory_base_fixed_path}/.sisu/#{SiSU_is[:version_dir]}/skin/yml", "#{$sisu_document_markup_directory_base_fixed_path}/.sisu/skin/yml", - "#{$sisu_document_markup_directory_base_fixed_path}/_sisu/#{SiSU_version_dir}/skin/yml", + "#{$sisu_document_markup_directory_base_fixed_path}/_sisu/#{SiSU_is[:version_dir]}/skin/yml", "#{$sisu_document_markup_directory_base_fixed_path}/_sisu/skin/yml", - "#{@@home}/.sisu/#{SiSU_version_dir}/skin/yml", + "#{@@home}/.sisu/#{SiSU_is[:version_dir]}/skin/yml", "#{@@home}/.sisu/skin/yml", - "#{@@sisu_etc}/#{SiSU_version_dir}/skin/yml", + "#{@@sisu_etc}/#{SiSU_is[:version_dir]}/skin/yml", "#{@@sisu_etc}/skin/yml", ] @ad_path.each do |v| @@ -823,11 +823,11 @@ module SiSU_Env : (STDERR.puts "\t*WARN* #{program} is not installed #{program_ref}") end def tex2pdf_engine - prog=['xetex','xelatex','pdflatex','pdfetex','pdftex'] + progs=['xetex','xelatex','pdflatex','pdfetex','pdftex'] @pdfetex_flag=false @cmd ||='' @texpdf=nil - prog.each do |program| + progs.each do |program| if program_found?(program) @texpdf=program if program =~/xetex|xelatex|pdftex|pdflatex/ @pdfetex_flag=true @@ -835,7 +835,7 @@ module SiSU_Env end end if @pdfetex_flag==false - @texpdf=prog.join(', ') + @texpdf=progs.join(', ') end @texpdf end @@ -847,7 +847,6 @@ module SiSU_Env else %q{2>&1 | grep -v '$'} end mode='batchmode' #mode='nonstopmode' - program_ref="\n\t\tSee http://www.tug.org/applications/pdftex/\n\t\tOn Debian this is is included in tetex-extra" texpdf=tex2pdf_engine if @pdfetex_flag texpdf_cmd=case texpdf @@ -861,7 +860,7 @@ module SiSU_Env "#{texpdf} -interaction=#{mode} #{@input} #{tell}\n" end system(texpdf_cmd) - else STDERR.puts "\t*WARN* none of the following programs are installed: #{program[0]}, #{program[1]}, #{program[2]} is installed. #{program_ref}" + else STDERR.puts "\t*WARN* none of the following programs are installed: #{@texpdf}" end end def makeinfo #texinfo @@ -1060,17 +1059,10 @@ module SiSU_Env @fixed_websev_root='' # @home @pwd=@@pwd=Dir.pwd m=/.+\/(?:src\/)?(\S+)/m # m=/.+?\/(?:src\/)?([^\/]+)$/im # m=/.+\/(\S+)/m - @stub_pwd=@@pwd[m,1] - @stub_txt= @stub_pwd + '/txt' - @stub_html= @stub_pwd + '/html' - @stub_epub= @stub_pwd + '/epub' - @stub_odt= @stub_pwd + '/odt' - @stub_pdf= @stub_pwd + '/pdf' - @stub_manifest=@stub_pwd + '/manifest' - @stub_odt= @stub_pwd + '/odt' + @stub_pwd=@@pwd[m,1] || '' #; p __LINE__; #p @pwd; #p m; #p @stub_pwd @stub_src= @stub_pwd + '/src' @stub_pod= @stub_pwd + '/pod' - @stub_md= @stub_pwd + '/sisu_site_metadata' + @stub_epub= @stub_pwd + '/epub' pt=Pathname.new(Dir.pwd) stub=if output_dir_structure.by_language_code? r=Px[:lng_lst_rgx] @@ -1946,36 +1938,15 @@ WOK def stub_pwd @stub_pwd end - def stub_txt - @stub_txt - end - def stub_html - @stub_html - end def stub_epub @stub_epub end - def stub_odt - @stub_odt - end - def stub_pdf - @stub_pdf - end - def stub_manifest - @stub_manifest - end - def stub_set_manifest - @stub_set_manifest - end def stub_src @stub_src end def stub_pod @stub_pod end - def stub_md_harvest - @stub_set_manifest - end def etc defaults[:sisu_etc] #live/dynamic end @@ -1989,7 +1960,7 @@ WOK @sys.dir_bin end def share #shared data repository source directory - defaults[:sisu_share] + defaults[:sisu_share] #; p __LINE__.to_s + ':' + __FILE__ + ' ' + defaults[:sisu_share] end def style if @md \ @@ -2904,7 +2875,7 @@ WOK def odf_structure FileUtils::rm_rf(processing_path.processing_path.odf_pth) FileUtils::mkdir_p(processing_path.processing_path.odf_pth) - system("unzip -q #{path.share}/#{SiSU_version_dir}/odf/odt.zip -d #{processing_path.odf_pth}") + system("unzip -q #{path.share}/#{SiSU_is[:version_dir]}/odf/odt.zip -d #{processing_path.odf_pth}") end def sisupod_gen(fns_pod) sisupod_gen_v3(fns_pod) @@ -3709,18 +3680,15 @@ WOK def get_version @version={} @pwd=ENV['PWD'] - yst_ver=SiSU_path_specified_Version_ \ - ? SiSU_path_specified_Version_ - : "#{defaults[:sisu_share]}/#{SiSU_version_dir}/v/version.yml" lib_path=@@lib_path ? @@lib_path : `echo $RUBYLIB`.split(':') @@lib_path ||=lib_path - if File.exist?(yst_ver) - @version=YAML::load(File::open(yst_ver)) #unless @@noyaml + if File.exist?(SiSU_is[:version_info_path]) + @version=YAML::load(File::open(SiSU_is[:version_info_path])) #unless @@noyaml end - @version[:install_method]=if SiSU_is==:gem_install + @version[:install_method]=if SiSU_is[:run_from]==:gem_install spec = Gem::Specification.find_by_name("sisu") gem_root = spec.gem_dir - (File.dirname(__FILE__.gsub(/\/lib\/sisu\/#{SiSU_version_dir}/,'')) == gem_root) \ + (File.dirname(__FILE__.gsub(/\/lib\/sisu\/#{SiSU_is[:version_dir]}/,'')) == gem_root) \ ? ' (ruby gem install)' : '' else '' end @@ -6934,12 +6902,7 @@ WOK cp_images(src,dest) if FileTest.directory?(src) end def cp_base_images #fix images - src=if SiSU_path_base == :system_default \ - or SiSU_path_base == nil - @env.path.share + '/image' - else - SiSU_path_base + '/data/sisu/image' - end + src=SiSU_is[:path_base_system_data] + '/image' dest_arr=[ "#{@env.path.webserv}/_sisu/image_sys", "#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/image_sys" @@ -1,5 +1,4 @@ #!/usr/bin/env ruby -raise 'Please, use ruby1.9.3 or later.' if RUBY_VERSION < '1.9.3' =begin Common Rakefile, Rantfile installer for SiSU softlink Rakefile and Rantfile to this file @@ -38,8 +37,8 @@ raise 'Please, use ruby1.9.3 or later.' if RUBY_VERSION < '1.9.3' #require 'mkmf' #create_makefile("sisu") #% manual settings, edit/update as required (note current default settings are obtained from sisu version yml file) -SiSU_version_next_stable = '4.2.18' -SiSU_version_next_unstable = '5.2.1' +SiSU_version_next_stable = '4.2.20' +SiSU_version_next_unstable = '5.2.3' #% rake file SiSU_version_generic_next_stable = '4.2.x' SiSU_version_generic_next_unstable = '5.2.x' @@ -355,6 +354,7 @@ Gem::Specification.new do |s| s.email = 'ralph.amissah@gmail.com' s.files = Dir['lib/#{Project_details.name.downcase}/#{version}/*.rb'] + Dir['data/#{Project_details.name.downcase}/#{version}/v/version.yml'] + + Dir['data/#{Project_details.name.downcase}/image/*'] + Dir['bin/#{Project_details.name.downcase}gem'] + Dir['bin/#{Project_details.name.downcase}'] s.license = 'GPL3' |