File: test-wrapper.sh

package info (click to toggle)
postgrey 1.37-2.2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 528 kB
  • sloc: perl: 1,339; sh: 221; makefile: 17
file content (24 lines) | stat: -rwxr-xr-x 676 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
22
23
24
#!/bin/sh

# we need a wrapper to allow loading of modules from a non-system path, and we can't use PERL5LIB because of taint mode (-T)

GID=`id -g`
UID=`id -u`
OPTS="--user=$UID --group=$GID"
DEFAULT_LIB_ROOT="$HOME/perl5"

# note that this script assumes that we are run in the test directory and that postgrey is in ../postgrey
if [ ! -f ../postgrey ]; then
    echo "ERROR: ../postgrey not found. are you running this script from the test directory?" >&2
    exit 1
fi

[ -d $DBDIR ] || mkdir $DBDIR

if [ -n "$PERL_LOCAL_LIB_ROOT" ]; then
    LIB_ROOT=$PERL_LOCAL_LIB_ROOT
else
    LIB_ROOT=$DEFAULT_LIB_ROOT
fi

exec perl -T -I$LIB_ROOT/lib/perl5 ../postgrey $OPTS "$@"