awful debugging hacking
[dpkg] / run-script
1 #!/bin/sh
2
3 top_srcdir="`dirname "$0"`"
4
5 # To avoid using «readlink -f» or «realpath» we just change into the
6 # desired directory and work from there.
7 cd "$top_srcdir"
8 cwd="`pwd`"
9 cd "$OLDPWD"
10
11 # Set up the environment, to use local perl modules and data files.
12 export PERL="${PERL:-perl}"
13 export PERL5LIB="$cwd/scripts:$cwd/dselect/methods"
14 export DPKG_DATADIR="$cwd/data"
15
16 script="$1"
17 shift 1
18
19 exec $PERL $PERL_PROFILE "$cwd/$script" "$@"