diff options
author | Ralph Amissah <ralph@amissah.com> | 2011-03-24 20:24:15 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2011-03-24 20:24:15 -0400 |
commit | e158c914b4f353c4d3aaf682cbe0d52d87e7f8ee (patch) | |
tree | feb1754689976a2cb83530864c53060a2f49e9e3 /bin/sisu_termsheet | |
parent | debian/changelog (3.0.4-1) (diff) | |
parent | v2, v3: texpdf bugfix, where map_nametags not found, drop tag, rather than crash (diff) |
Merge branch 'upstream' into debian/sid
Diffstat (limited to 'bin/sisu_termsheet')
-rw-r--r-- | bin/sisu_termsheet | 80 |
1 files changed, 65 insertions, 15 deletions
diff --git a/bin/sisu_termsheet b/bin/sisu_termsheet index 47af2dcc..10318191 100644 --- a/bin/sisu_termsheet +++ b/bin/sisu_termsheet @@ -1,22 +1,72 @@ #!/usr/bin/env ruby # encoding: utf-8 #SiSU: copyright (C) 1997 - 2011 Ralph Amissah; License GPL, see appended program information -raise "Please, use Ruby1.8 (1.8.4 or later), current Ruby #{RUBY_VERSION}" if RUBY_VERSION < '1.8.4' or RUBY_VERSION > '1.9' -#raise "Please, use Ruby1.8.4 or later, current Ruby #{RUBY_VERSION}" if RUBY_VERSION < '1.8.4' -$VERBOSE=nil -argv=$* -SiSU_version_dir=case argv.inspect -when /--v2/ - 'v2' -when /--v3/ - 'v3' -when /--dev/ - 'v3' -else - 'v2' +begin + def check_sisu_stable_ruby_version? + rbv_sisu_stable='1.8.7' + if RUBY_VERSION < rbv_sisu_stable + raise "Please, use Ruby#{rbv_sisu_stable} or later, current Ruby #{RUBY_VERSION}" + else check_incompatible_ruby_build? + end + end + def check_sisu_dev_ruby_version? + rbv_sisu_dev='1.9.2' + if RUBY_VERSION < rbv_sisu_dev + raise "Please, use Ruby#{rbv_sisu_dev} or later, current Ruby #{RUBY_VERSION}" + else check_incompatible_ruby_build? + end + end + def check_incompatible_ruby_build? + require 'rbconfig' + e=Config::CONFIG + if RUBY_VERSION == '1.9.2' \ + and e['PATCHLEVEL'].to_i < 180 + raise <<WOK +There are known issues with early versions of ruby1.9.2. +Please, use Ruby 1.9.2p180 or later, +current version #{e['RUBY_PROGRAM_VERSION']}p#{e['PATCHLEVEL']} +#{%x{ruby -v}.strip.to_s} + +WOK + end + end + $VERBOSE=nil + argv=$* + SiSU_version_dir=case argv.inspect + when /--v2/ + check_sisu_stable_ruby_version? + 'v2' + when /--v3/ + check_sisu_dev_ruby_version? + 'v3' + when /--dev/ + check_sisu_dev_ruby_version? + 'v3' + else + check_sisu_stable_ruby_version? + 'v2' + end + SiSU_lib="sisu/#{SiSU_version_dir}" + require "#{SiSU_lib}/termsheet" +rescue + STDERR.puts 'ERROR' + STDERR.puts $! + STDERR.puts $@ + require 'rbconfig' + 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']} + } + system(%{echo " + system RUBYPATH: ${RUBYPATH} + system RUBYLIB: ${RUBYLIB} + "}) end -SiSU_lib="sisu/#{SiSU_version_dir}" -require "#{SiSU_lib}/termsheet" __END__ * Name: SiSU |