aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--bin/sisu70
-rw-r--r--data/doc/sisu/CHANGELOG_v44
-rw-r--r--data/doc/sisu/CHANGELOG_v54
-rw-r--r--lib/sisu/v4/sysenv.rb21
-rw-r--r--lib/sisu/v5/sysenv.rb23
5 files changed, 53 insertions, 69 deletions
diff --git a/bin/sisu b/bin/sisu
index 102d10d1..ad98138b 100644
--- a/bin/sisu
+++ b/bin/sisu
@@ -2,45 +2,6 @@
# encoding: utf-8
#SiSU: copyright (C) 1997 - 2014 Ralph Amissah; License GPL 3, see appended program information
begin
- def ruby_version_ok?(base_version)
- @v ||=RUBY_VERSION.scan(/\d+/)
- vb=base_version.scan(/\d+/)
- if @v[0].to_i < vb[0].to_i \
- or @v[0].to_i == vb[0].to_i \
- && @v[1].to_i < vb[1].to_i \
- or @v[0].to_i == vb[0].to_i \
- && @v[1].to_i == vb[1].to_i \
- && @v[1].to_i < vb[2].to_i
- raise "Please, use Ruby#{vb} 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' \
- && 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
- def check_sisu_legacy_ruby_version?
- rbv_sisu_legacy='1.9.2' #'1.8.7'
- ruby_version_ok?(rbv_sisu_legacy)
- end
- def check_sisu_stable_ruby_version?
- rbv_sisu_stable='1.9.2'
- ruby_version_ok?(rbv_sisu_stable)
- end
- def check_sisu_dev_ruby_version?
- rbv_sisu_dev='1.9.2'
- ruby_version_ok?(rbv_sisu_dev)
- end
def require_hub_path(sisu_path_specified_lib_)
if sisu_path_specified_lib_ \
&& FileTest.file?("#{sisu_path_specified_lib_}/#{SiSU_lib}/hub.rb")
@@ -51,21 +12,22 @@ WOK
end
#% sisu branch
$VERBOSE=nil
- $KCODE='u' if RUBY_VERSION < '1.9'
argv=$*
SiSU_called_from_directory=Dir.pwd
+ sisu_is_=:system_install
require 'rubygems'
- check_sisu_stable_ruby_version?
- default_version=if __FILE__ =~/gem/ \
+ default_version=if __FILE__ =~/\/gems\// \
and __FILE__ =~/\/sisu-[45]\.(?:\d+|[a-z])\.(?:\d+|[a-z])\//
- SiSU_version_dir=case __FILE__
+ sisu_is_=: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'
end
else 'v4'
end
- SiSU_version_dir=case $0
+ SiSU_is=sisu_is_
+ sisu_version_dir_=case $0
when /\bsisu4$/ then 'v4'
when /\bsisu5$/ then 'v5'
else
@@ -75,10 +37,11 @@ WOK
else default_version
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]?$/
- nil
+ sisu_path_base=if $0 =~ /^#{e['bindir']}\/sisu[45]?$/
+ :system_default
elsif $0 !~ /^#{e['bindir']}\/sisu[45]?$/ \
&& File.expand_path($0) =~/bin\/sisu[45]?$/ \
&& FileTest.file?($0)
@@ -87,16 +50,19 @@ WOK
nil
end
SiSU_lib="sisu/#{SiSU_version_dir}"
- sisu_path_specified_lib_=SiSU_path_base \
+ sisu_path_specified_lib_=($0 !~ /^#{e['bindir']}\/sisu[45]?$/) \
? File.expand_path($0).sub(/bin\/sisu[45]?$/,'lib')
: nil
- SiSU_path_specified_Version_=if __FILE__ =~/gem/
- spec = Gem::Specification.find_by_name("sisu")
- spec.gem_dir + "/data/sisu/#{SiSU_version_dir}/v/version.yml"
- elsif SiSU_path_base
- "#{SiSU_path_base}/data/sisu/#{SiSU_version_dir}/v/version.yml"
+ 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_)}"
#% $*
require "#{SiSU_path_lib}/hub"
diff --git a/data/doc/sisu/CHANGELOG_v4 b/data/doc/sisu/CHANGELOG_v4
index 4843b82b..26a3c700 100644
--- a/data/doc/sisu/CHANGELOG_v4
+++ b/data/doc/sisu/CHANGELOG_v4
@@ -30,6 +30,10 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_4.2.19.orig.tar.xz
sisu_4.2.19.orig.tar.xz
sisu_4.2.19-1.dsc
+* bin/sisu experimentation
+ * start preparing for ruby changes
+ * work on fix for bug related to gem path & system installed sisu
+
%% 4.2.18.orig.tar.xz (2014-01-12:01/7)
http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_4.2.18
http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/debian/sisu_4.2.18-1
diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5
index 1815f5ce..9cabec20 100644
--- a/data/doc/sisu/CHANGELOG_v5
+++ b/data/doc/sisu/CHANGELOG_v5
@@ -33,6 +33,10 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_5.2.2.orig.tar.xz
sisu_5.2.2.orig.tar.xz
sisu_5.2.2-1.dsc
+* bin/sisu experimentation
+ * start preparing for ruby changes
+ * work on fix for bug related to gem path & system installed sisu
+
%% 5.2.1.orig.tar.xz (2014-01-12:01/7)
http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_5.2.1
http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/debian/sisu_5.2.1-1
diff --git a/lib/sisu/v4/sysenv.rb b/lib/sisu/v4/sysenv.rb
index b216089d..341a29f7 100644
--- a/lib/sisu/v4/sysenv.rb
+++ b/lib/sisu/v4/sysenv.rb
@@ -3599,11 +3599,13 @@ WOK
if File.exist?(yst_ver)
@version=YAML::load(File::open(yst_ver)) #unless @@noyaml
end
- spec = Gem::Specification.find_by_name("sisu")
- gem_root = spec.gem_dir
- @version[:install_method]=(File.dirname(__FILE__.gsub(/\/lib\/sisu\/#{SiSU_version_dir}/,'')) == gem_root) \
- ? ' (ruby gem install)'
- : ''
+ @version[:install_method]=if SiSU_is==: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) \
+ ? ' (ruby gem install)' : ''
+ else ''
+ end
@version
end
def rbversion
@@ -6320,9 +6322,12 @@ WOK
cp_images(src,dest) if FileTest.directory?(src)
end
def cp_base_images #fix images
- src=SiSU_path_base \
- ? SiSU_path_base + '/data/sisu/image'
- : "#{@env.path.share}/image"
+ src=if SiSU_path_base == :system_default \
+ or SiSU_path_base == nil
+ @env.path.share + '/image'
+ else
+ SiSU_path_base + '/data/sisu/image'
+ end
dest_arr=[
"#{@env.path.webserv}/_sisu/image_sys",
"#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/image_sys"
diff --git a/lib/sisu/v5/sysenv.rb b/lib/sisu/v5/sysenv.rb
index 954fb179..e04882d7 100644
--- a/lib/sisu/v5/sysenv.rb
+++ b/lib/sisu/v5/sysenv.rb
@@ -117,7 +117,7 @@ module SiSU_Env
processing_pth=tmp_processing_individual
processing_dir=prcss_dir
processing_git="#{Dir.pwd}/#{Gt[:grotto]}"
- user=ENV['USER']
+ #user=ENV['USER']
port_pgsql=if defined? ENV['PGPORT'] \
and not (ENV['PGPORT'].nil? \
|| ENV['PGPORT'].empty?) \
@@ -3717,11 +3717,13 @@ WOK
if File.exist?(yst_ver)
@version=YAML::load(File::open(yst_ver)) #unless @@noyaml
end
- spec = Gem::Specification.find_by_name("sisu")
- gem_root = spec.gem_dir
- @version[:install_method]=(File.dirname(__FILE__.gsub(/\/lib\/sisu\/#{SiSU_version_dir}/,'')) == gem_root) \
- ? ' (ruby gem install)'
- : ''
+ @version[:install_method]=if SiSU_is==: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) \
+ ? ' (ruby gem install)' : ''
+ else ''
+ end
@version
end
def rbversion
@@ -6932,9 +6934,12 @@ WOK
cp_images(src,dest) if FileTest.directory?(src)
end
def cp_base_images #fix images
- src=SiSU_path_base \
- ? SiSU_path_base + '/data/sisu/image'
- : "#{@env.path.share}/image"
+ src=if SiSU_path_base == :system_default \
+ or SiSU_path_base == nil
+ @env.path.share + '/image'
+ else
+ SiSU_path_base + '/data/sisu/image'
+ end
dest_arr=[
"#{@env.path.webserv}/_sisu/image_sys",
"#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/image_sys"