mirror of
https://github.com/yaobinwen/dpkg.git
synced 2026-01-12 08:20:35 +00:00
The cd commands might fail, so we should either check their return values or globally make errors fatal. Let's do the latter. Warned-by: shellcheck
22 lines
442 B
Bash
Executable File
22 lines
442 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
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 PERL="${PERL:-perl}"
|
|
export PERL5LIB="$cwd/scripts:$cwd/dselect/methods"
|
|
export DPKG_DATADIR="$cwd/data"
|
|
|
|
script="$1"
|
|
shift 1
|
|
|
|
exec "$PERL" "$cwd/$script" "$@"
|