From 0b047c0e68bee2c86326a595ccc31faf649ca6ff Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 6 Mar 2013 18:09:39 -0500 Subject: v4: bin/sisu, expand given path for sisu executable * where system sisu not called directly --- bin/sisu | 28 +++++++++++----------------- data/doc/sisu/CHANGELOG_v4 | 3 +++ 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/bin/sisu b/bin/sisu index b7156f43..daa2a48d 100644 --- a/bin/sisu +++ b/bin/sisu @@ -82,30 +82,24 @@ WOK 'v4' end end -#% $0 +#% $0 File.expand_path($0) e=Config::CONFIG - SiSU_lib="sisu/#{SiSU_version_dir}" - sisu_path_specified_lib_=if $0 =~ /^#{e['bindir']}\/sisu[34]?$/ + SiSU_path_base=if $0 =~ /^#{e['bindir']}\/sisu[34]?$/ nil elsif $0 !~ /^#{e['bindir']}\/sisu[34]?$/ \ - && $0 =~/bin\/sisu[34]?$/ \ - && FileTest.file?($0) - $0.sub(/bin\/sisu[34]?$/,'lib'). - sub(/^lib$/,"#{Dir.pwd}/lib") - elsif $0 !~ /^#{e['bindir']}\/sisu[34]?$/ \ - && $0 =~/^sisu[34]?$/ \ + && File.expand_path($0) =~/bin\/sisu[34]?$/ \ && FileTest.file?($0) - $0.sub(/sisu[34]?$/,'../lib') - #bug, relative path does not work for sisu version information - else - nil - end - SiSU_path_specified_Version_=if sisu_path_specified_lib_ - sisu_path_specified_lib_.sub(/\/lib/, - "/data/sisu/#{SiSU_version_dir}/v/version.yml") + File.expand_path($0).sub(/\/bin\/sisu[34]?$/,'') else nil end + SiSU_lib="sisu/#{SiSU_version_dir}" + sisu_path_specified_lib_=SiSU_path_base \ + ? File.expand_path($0).sub(/bin\/sisu[34]?$/,'lib') + : nil + SiSU_path_specified_Version_=SiSU_path_base \ + ? "#{SiSU_path_base}/data/sisu/#{SiSU_version_dir}/v/version.yml" + : nil 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 3da0ae98..7c085ee8 100644 --- a/data/doc/sisu/CHANGELOG_v4 +++ b/data/doc/sisu/CHANGELOG_v4 @@ -28,6 +28,9 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_4.0.11.orig.tar.xz sisu_4.0.11.orig.tar.xz sisu_4.0.11-1.dsc +* v4: bin/sisu, expand given path for sisu executable + (where system sisu not called directly) + %% 4.0.10.orig.tar.xz (2013-03-05:09/2) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_4.0.10 http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/debian/sisu_4.0.10-1 -- cgit v1.2.3