deb: Move post-remove cleanup to the pre-remove script.

This commit is contained in:
Tom Goff 2016-01-29 11:47:30 -05:00
parent 7f1ed4dbf9
commit f733aba833
3 changed files with 10 additions and 15 deletions

View file

@ -30,7 +30,6 @@ EXTRA_DIST = bootstrap.sh LICENSE README-Xen Changelog kernel \
packaging/deb/compat \
packaging/deb/copyright \
packaging/deb/changelog \
packaging/deb/core.postrm \
packaging/deb/rules \
packaging/deb/control \
packaging/deb/core-daemon.install.in \

View file

@ -15,14 +15,22 @@ set -e
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
SBINDIR=@SBINDIR@
pyprefix=@pyprefix@
pythondir=@pythondir@
core_daemon_stop()
{
if [ -x /etc/init.d/core-daemon ]; then
/etc/init.d/core-daemon stop
fi
if [ -x @SBINDIR@/core-cleanup ]; then
@SBINDIR@/core-cleanup
if [ -x $SBINDIR/core-cleanup ]; then
$SBINDIR/core-cleanup
fi
if [ -d $pythondir/core ]; then
find $pythondir/core -name '*.pyc' -delete
fi
}

View file

@ -1,12 +0,0 @@
#!/bin/sh
if [ "$1" = "remove" ]; then
PYTHONS="python2.6 python2.7"
for P in $PYTHONS
do
DIR="usr/lib/$P/dist-packages/core"
if [ -d $DIR ]; then
find $DIR -name '*.pyc' -exec rm -f '{}' ';' 2> /dev/null
fi
done
fi