[Piuparts-commits] [piuparts] 49/51: p: do not ignore errors while removing packages

Holger Levsen holger at layer-acht.org
Thu Jul 20 21:15:06 UTC 2017


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch develop
in repository piuparts.

commit 61e75b94e8f6bcea375e9a196005ee7de1b66b64
Author: Andreas Beckmann <anbe at debian.org>
Date:   Mon Jul 10 10:41:02 2017 +0200

    p: do not ignore errors while removing packages
    
    this is no longer needed nowadays and actually hides some problems
    
    continue to ignore the errors from the intermediate revoval performed in
    --install-remove-install tests, we might try to remove essential packages
    
    Signed-off-by: Andreas Beckmann <anbe at debian.org>
    Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
 debian/changelog |  1 +
 piuparts.py      | 10 +++++-----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index ca34078..3301b0c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -18,6 +18,7 @@ piuparts (0.78) UNRELEASED; urgency=medium
       will verbosely log the ignored files if matched.
     - New option --upgrade-before-dist-upgrade for 2-stage upgrades:
       'apt-get upgrade && apt-get dist-upgrade'.
+    - Do not ignore errors while removing packages.
   * piuparts.conf:
     - Use more aliases for mapping between releases and codenames to reduce
       the amount of changes needed on "moving targets" (like stable22sid)
diff --git a/piuparts.py b/piuparts.py
index f6d575c..c0fd1ab 100644
--- a/piuparts.py
+++ b/piuparts.py
@@ -1428,10 +1428,10 @@ class Chroot:
             if not settings.warn_on_install_over_symlink:
                 panic()
 
-    def remove_packages(self, packages):
+    def remove_packages(self, packages, ignore_errors=False):
         """Remove packages in a chroot."""
         if packages:
-            self.run(["apt-get", "remove"] + unqualify(packages), ignore_errors=True)
+            self.run(["apt-get", "remove"] + unqualify(packages), ignore_errors=ignore_errors)
 
     def purge_packages(self, packages):
         """Purge packages in a chroot."""
@@ -2588,7 +2588,7 @@ def install_purge_test(chroot, chroot_state, package_files, packages, extra_pack
         chroot.install_packages(package_files, packages, with_scripts=True)
 
     if settings.install_remove_install:
-        chroot.remove_packages(packages)
+        chroot.remove_packages(packages, ignore_errors=True)
         logging.info("Reinstalling after remove")
         chroot.install_packages(package_files, packages, with_scripts=True)
         chroot.install_packages(package_files, packages, with_scripts=True, reinstall=True)
@@ -2625,7 +2625,7 @@ def install_upgrade_test(chroot, chroot_state, package_files, packages, old_pack
     chroot.check_for_broken_symlinks()
 
     if settings.install_remove_install:
-        chroot.remove_packages(packages)
+        chroot.remove_packages(packages, ignore_errors=True)
 
     # Then from the package files.
     os.environ["PIUPARTS_PHASE"] = "upgrade"
@@ -2755,7 +2755,7 @@ def install_and_upgrade_between_distros(package_files, packages_qualified):
     chroot.install_packages_by_name(known_packages)
 
     if settings.install_remove_install:
-        chroot.remove_packages(packages)
+        chroot.remove_packages(packages, ignore_errors=True)
         distupgrade_packages = []
 
     chroot.check_for_no_processes()

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/piuparts/piuparts.git



More information about the Piuparts-commits mailing list