1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
|
#!/bin/sh
# PCP QA Test No. 1346
# dpkg packaging botches for old conffiles
#
# Copyright (c) 2021 Ken McDonell. All Rights Reserved.
#
seq=`basename $0`
echo "QA output created by $seq"
# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check
if which dpkg >/dev/null 2>&1
then
:
else
_notrun "no dpkg, probably not even Debian"
# NOTREACHED
fi
if [ -f "`echo ../build/deb/pcp_*.deb`" ]
then
:
else
_notrun "no pcp deb package in ../build/deb, probably running from testsuite"
# NOTREACHED
fi
_cleanup()
{
cd $here
$sudo rm -rf $tmp $tmp.*
}
status=0 # success is the default!
trap "_cleanup; exit \$status" 0 1 2 3 15
# Some files may be left over after changes in the build rules,
# e.g. a PMDA used to be built, was installed in the past, but
# now is no longer being built
#
_cull_special()
{
sed \
-e '/^\/etc\/pcp\/pmrep\/xtract-names$/d' \
# end
}
LC_COLLATE=POSIX; export LC_COLLATE
# real QA test starts here
echo "Silence is golden ..."
dpkg-deb -c ../build/deb/pcp_*.deb \
| awk '{print $6}' \
| sed -e 's/^\.//' -e 's@/$@@' -e '/^$/d' \
| sort >$tmp.pkg
dpkg -L pcp \
| sed -e '/^\/.$/d' \
| _cull_special \
| sort >$tmp.installed
comm -13 $tmp.pkg $tmp.installed >$tmp.tmp
if [ -s $tmp.tmp ]
then
echo "Installed files belonging to pcp, but not in latest package ..."
cat $tmp.tmp
fi
comm -23 $tmp.pkg $tmp.installed >$tmp.tmp
if [ -s $tmp.tmp ]
then
echo
echo "Files in latest package but not installed! ..."
cat $tmp.tmp
fi
# success, all done
exit
|