[Piuparts-commits] [SCM] Git repository for piuparts branch, develop, updated. 59da8abf211bf9ec58c089664bc9a2dd248071ba
Holger Levsen
holger at layer-acht.org
Mon Sep 26 16:41:25 UTC 2011
The following commit has been merged in the develop branch:
commit 59da8abf211bf9ec58c089664bc9a2dd248071ba
Author: Holger Levsen <holger at layer-acht.org>
Date: Mon Sep 26 18:37:50 2011 +0200
piuparts.py: apply patch by Stefano Rivera to properly install and remove logrotate. Thanks Stefano! (Closes: #638832)
diff --git a/debian/changelog b/debian/changelog
index 1c20442..47e8408 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -9,6 +9,10 @@ piuparts (0.42) UNRELEASED; urgency=low
are filed already.
* debian/control: Add python-apt and python-debianbts to piuparts depends.
+ [ Holger Levsen ]
+ * piuparts.py: apply patch by Stefano Rivera to properly install and remove
+ logrotate. Thanks Stefano! (Closes: #638832)
+
-- Holger Levsen <holger at debian.org> Sun, 28 Aug 2011 09:50:12 +0200
piuparts (0.41) unstable; urgency=low
diff --git a/piuparts.py b/piuparts.py
index 965c1f9..a731af2 100644
--- a/piuparts.py
+++ b/piuparts.py
@@ -913,7 +913,10 @@ class Chroot:
logrotatefiles, logrotatefiles_list = self.check_if_logrotatefiles(packages)
if not settings.skip_logrotatefiles_test and logrotatefiles:
+ installed = self.install_logrotate()
self.check_output_logrotatefiles(logrotatefiles_list)
+ for pkg in installed:
+ self.remove_or_purge("purge", installed)
# Then purge all packages being depended on.
self.remove_or_purge("purge", deps_to_purge)
@@ -921,15 +924,6 @@ class Chroot:
# Finally, purge actual packages.
self.remove_or_purge("purge", nondeps_to_purge)
- # remove logrotate and it's depends
- # (this is a fix for #602409 introduced by #566597
- # - search for the latter bug number in this file)
- # XXX: another crude hack: ^^^
- if not settings.skip_logrotatefiles_test:
- self.remove_or_purge("remove", ["adduser", "cron", "libpopt0", "logrotate"])
- self.remove_or_purge("purge", ["adduser", "cron", "libpopt0", "logrotate"])
- self.run(["apt-get", "clean"])
-
# Run custom scripts after purge all packages.
if settings.scriptsdir is not None:
self.run_scripts("post_purge")
@@ -1135,13 +1129,19 @@ class Chroot:
return has_logrotatefiles, vlist
+ def install_logrotate(self):
+ """Install logrotate for check_output_logrotatefiles, and return the
+ list of packages that were installed"""
+ old_selections = self.get_selections()
+ self.run(['apt-get', 'install', '-y', 'logrotate'])
+ self.run(['apt-get', 'clean'])
+ diff = diff_selections(self, old_selections)
+ return diff.keys()
+
def check_output_logrotatefiles (self, list):
"""Check if a given list of logrotatefiles has any output. Executes
logrotate file as logrotate would do from cron (except for SHELL)"""
failed = False
- # XXX That's a crude hack (to fix #602409). Can't we define a set of needed packages differently?
- # It also introduces the need for hack to fix #602409 in piuparts.py
- (a,b) = self.run(['apt-get','install', '-y', 'logrotate'])
for vfile in list:
if not os.path.exists(self.relative(vfile.strip("/"))):
--
Git repository for piuparts
More information about the Piuparts-commits
mailing list