summaryrefslogtreecommitdiff
path: root/run-script
blob: b6c6a755536bdfc56ddb8e97b5a0e01d61053c82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

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="$cwd/scripts:$cwd/dselect/methods"
export DPKG_DATADIR="$cwd"

interp="$1"
script="$2"
shift 2

exec $interp "$cwd/$script" "$@"