diff options
author | Guillem Jover <guillem@debian.org> | 2015-05-04 05:41:44 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2015-05-09 06:19:39 +0200 |
commit | 1e61694dcd22ac8b16b55325c31ccc4bcf312f1b (patch) | |
tree | 365b1f7de36d90f5af158df5b4b6a88126b580b9 /run-script | |
parent | de6bbfc869da500094a584d95c8d584ae5f75dea (diff) | |
download | dpkg-1e61694dcd22ac8b16b55325c31ccc4bcf312f1b.tar.gz |
build: Allow running scripts from outside the source tree
Diffstat (limited to 'run-script')
-rwxr-xr-x | run-script | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/run-script b/run-script index cebab5b69..0832f904d 100755 --- a/run-script +++ b/run-script @@ -5,9 +5,15 @@ top_srcdir=`dirname $0` # To avoid using «readlink -f» or «realpath» we just change into the # desired directory and work from there. cd "$top_srcdir" +cwd=`pwd` +cd "$OLDPWD" # Set up the environment, to use local perl modules and data files. -export PERL5LIB=`pwd`/scripts:`pwd`/dselect/methods -export DPKG_DATADIR=`pwd` +export PERL5LIB=$cwd/scripts:$cwd/dselect/methods +export DPKG_DATADIR=$cwd -exec "$@" +interp=$1 +script=$2 +shift 2 + +exec $interp "$cwd/$script" "$@" |