diff options
author | Ralph Amissah <ralph@amissah.com> | 2014-01-20 18:53:25 -0500 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2014-01-20 18:53:25 -0500 |
commit | da2ee7b4e82a6a66fdd92d42799c994525d4254a (patch) | |
tree | b12fc7de76bffe23a52e27db1484c9431287b2b0 /bin | |
parent | debian/changelog (4.2.19-1) (diff) | |
parent | v4 v5: sysenv for texpdf, fix for when tex to pdf generator is absent (diff) |
Merge tag 'sisu_4.2.20' into debian/sid
SiSU 4.2.20
Diffstat (limited to 'bin')
-rw-r--r-- | bin/sisu | 118 |
1 files changed, 67 insertions, 51 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} } |