aboutsummaryrefslogtreecommitdiffhomepage
path: root/debian/bin
diff options
context:
space:
mode:
Diffstat (limited to 'debian/bin')
-rw-r--r--debian/bin/sisu25
1 files changed, 16 insertions, 9 deletions
diff --git a/debian/bin/sisu b/debian/bin/sisu
index 0b149111..07aa1fb4 100644
--- a/debian/bin/sisu
+++ b/debian/bin/sisu
@@ -54,31 +54,35 @@ WOK
$KCODE='u' if RUBY_VERSION < '1.9'
argv=$*
SiSU_called_from_directory=Dir.pwd
- if $0 !~/\bsisu[45]$/
+ require 'rubygems'
+ check_sisu_stable_ruby_version?
+ if __FILE__ =~/gem/ \
+ and __FILE__ =~/sisu-[45]\.\d+\.\d+/
+ SiSU_version_dir=(__FILE__ =~/sisu-5\.\d+\.\d+/) \
+ ? 'v5'
+ : 'v4'
+ elsif $0 !~/\b(?:sisu[45]|sisugem)$/
SiSU_version_dir=case argv.inspect
when /"(?:--v4)"/
- check_sisu_stable_ruby_version?
'v4'
when /"(?:--v5)"/
- check_sisu_stable_ruby_version?
'v5'
- when /"(?:--dev)"/
- check_sisu_dev_ruby_version?
+ when /"--dev"/
'v5'
else
- check_sisu_stable_ruby_version?
'v4'
end
else
SiSU_version_dir=case $0
when /\bsisu4$/
- check_sisu_stable_ruby_version?
'v4'
when /\bsisu5$/
- check_sisu_stable_ruby_version?
'v5'
+ when /sisugem$/ # should have been caught earlier, unused, debug check
+ SiSU_version_dir=(__FILE__ =~/sisu-5\.\d+\.\d+/) \
+ ? 'v5'
+ : 'v4'
else
- check_sisu_stable_ruby_version?
'v4'
end
end
@@ -158,6 +162,7 @@ rescue
STDERR.puts $!
STDERR.puts $@
require 'rbconfig'
+ require 'rubygems'
e=Config::CONFIG
puts %{
#{%x{ruby -v}.strip.to_s}
@@ -166,6 +171,8 @@ rescue
ruby named: #{e['ruby_version']}
rubylib: #{e['rubylibdir']}
rubylib local: #{e['sitelibdir']}
+ gem dir: #{Gem.dir}
+ gem path: #{Gem.path}
}
system(%{echo "
system RUBYPATH: ${RUBYPATH}