File: run-script

package info (click to toggle)
dpkg 1.23.3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 59,056 kB
  • sloc: ansic: 40,197; perl: 30,221; sh: 18,907; cpp: 6,054; makefile: 5,222; sed: 127
file content (21 lines) | stat: -rwxr-xr-x 445 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/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" "$@"