From f733aba8331832d5dae04ed58dabada12e542865 Mon Sep 17 00:00:00 2001 From: Tom Goff Date: Fri, 29 Jan 2016 11:47:30 -0500 Subject: [PATCH] deb: Move post-remove cleanup to the pre-remove script. --- Makefile.am | 1 - packaging/deb/core-daemon.prerm.in | 12 ++++++++++-- packaging/deb/core.postrm | 12 ------------ 3 files changed, 10 insertions(+), 15 deletions(-) delete mode 100644 packaging/deb/core.postrm diff --git a/Makefile.am b/Makefile.am index 8b260f74..f5e415a7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 \ diff --git a/packaging/deb/core-daemon.prerm.in b/packaging/deb/core-daemon.prerm.in index 23512986..e8f134a9 100644 --- a/packaging/deb/core-daemon.prerm.in +++ b/packaging/deb/core-daemon.prerm.in @@ -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 } diff --git a/packaging/deb/core.postrm b/packaging/deb/core.postrm deleted file mode 100644 index 3f3bd2cc..00000000 --- a/packaging/deb/core.postrm +++ /dev/null @@ -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