aboutsummaryrefslogtreecommitdiff
path: root/sbopkglint
diff options
context:
space:
mode:
Diffstat (limited to 'sbopkglint')
-rwxr-xr-xsbopkglint37
1 files changed, 35 insertions, 2 deletions
diff --git a/sbopkglint b/sbopkglint
index d234e39..7e1638e 100755
--- a/sbopkglint
+++ b/sbopkglint
@@ -502,6 +502,41 @@ for package in $packages; do
VERSION="$( echo $filename | rev | cut -d- -f3 | rev )"
PKG="$( mktemp -d $TMP/sbopkglint.XXXXXX )"
+ totalwarns=0
+ foundtests=0
+
+ # pre-doinst test requires extracting the package *without*
+ # running its doinst.sh. this is so we can check for e.g.
+ # /usr/info/dir existing in the package (rather than being
+ # created by doinst, which would be OK).
+ echo -n "Exploding $package to $PKG ..."
+ olddir="$( pwd )"
+ cd "$PKG"
+ explodepkg "$PKG" &> $PKG/.tmp.$$
+ S="$?"
+ if [ "$S" != "0" ]; then
+ echo "FAILED"
+ echo "explodepkg exited with status $S"
+ rm -rf $PKG
+ exit_status=1
+ continue
+ fi
+ echo "OK"
+
+ echo -n "Running pre-doinst test..."
+ warncount=0
+ source $testdir/pre-doinst.sh
+ if [ "$warncount" = "0" ]; then
+ echo "OK"
+ else
+ echo "FAILED"
+ : $(( totalwarns += warncount ))
+ fi
+ cd "$olddir"
+ rm -rf $PKG
+ mkdir -p $PKG
+
+ # now the "real" tests
echo -n "Installing $package to $PKG ..."
/sbin/installpkg -root "$PKG" "$package" &> $PKG/.tmp.$$
S="$?"
@@ -521,8 +556,6 @@ for package in $packages; do
olddir="$( pwd )"
cd "$PKG"
- totalwarns=0
- foundtests=0
for testscript in $testdir/*.t.sh; do
foundtests=1
(