[Piuparts-commits] [SCM] piuparts git repository branch, develop, updated. 0.45-63-g397f4e3
Andreas Beckmann
debian at abeckmann.de
Thu Jul 19 17:43:56 UTC 2012
The following commit has been merged in the develop branch:
commit 397f4e31199999267d24cd418cf2b76703e4a1ea
Author: Andreas Beckmann <debian at abeckmann.de>
Date: Sun Jul 8 01:05:32 2012 +0200
p: check for chroot modifications after install+purge
Installing and purging a package (with the dependencies already
installed and kept installed during the install/purge cycle) should
leave the chroot in an unmodified state ... but sometimes maintainer
scripts clean up a bit too much or someone modified a config file or
conffile ... problems that go unnoticed if the dependencies are
cleaned up, too.
Signed-off-by: Andreas Beckmann <debian at abeckmann.de>
diff --git a/debian/changelog b/debian/changelog
index c87fbb1..fa1a5b1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -12,6 +12,9 @@ piuparts (0.46) UNRELEASED; urgency=low
package being tested instead of the dependencies in --warn-on-others mode.
- Implement --install-purge-install option: test purging with all
dependencies still installed; re-install after purge.
+ - Install the dependencies and snapshot the chroot before the
+ --install-purge-install test. Check that the chroot after purge matches
+ the snapshot. (Closes: #668713)
* piupartslib/dependencyparser.py:
- Package names may now have a ":any" qualification in some cases. Extend
the parser to recognize and discard this suffix.
diff --git a/piuparts.py b/piuparts.py
index 8e9be3f..24a159a 100644
--- a/piuparts.py
+++ b/piuparts.py
@@ -2023,7 +2023,7 @@ def install_purge_test(chroot, chroot_state, package_files, packages):
# Install packages into the chroot.
os.environ["PIUPARTS_PHASE"] = "install"
- if settings.warn_on_others:
+ if settings.warn_on_others or settings.install_purge_install:
# Create a metapackage with dependencies from the given packages
if package_files:
control_infos = []
@@ -2069,13 +2069,24 @@ def install_purge_test(chroot, chroot_state, package_files, packages):
# modifications were caused by the actual packages we are testing,
# rather than by their dependencies.
deps_info = chroot.save_meta_data()
+
+ if settings.install_purge_install:
+ # save chroot state with all deps installed
+ chroot_state_with_deps = {}
+ chroot_state_with_deps["tree"] = deps_info
+ chroot_state_with_deps["selections"] = chroot.get_selections()
+ chroot_state_with_deps["diversions"] = chroot.get_diversions()
else:
deps_info = None
chroot.install_packages(package_files, packages)
if settings.install_purge_install:
+ file_owners = chroot.get_files_owned_by_packages()
chroot.purge_packages(packages)
+ logging.info("Validating chroot after purge")
+ if not check_results(chroot, chroot_state_with_deps, file_owners, deps_info=deps_info):
+ return False
logging.info("Reinstalling after purge")
chroot.install_packages(package_files, packages)
--
piuparts git repository
More information about the Piuparts-commits
mailing list