[Piuparts-commits] [SCM] piuparts git repository branch, develop, updated. 0.42-50-g4ee7269

Andreas Beckmann debian at abeckmann.de
Mon Mar 5 13:56:34 UTC 2012


The following commit has been merged in the develop branch:
commit 4ee7269e0e01620f30e90df42ae951e70a0e637a
Author: Andreas Beckmann <debian at abeckmann.de>
Date:   Mon Mar 5 07:16:51 2012 +0100

    remove added and reinstall missing packages in one apt-get call
    
    Use 'apt-get remove ... $package+' to reinstall missing packages
    at the same time as removing the added packages, otherwise (in
    some rare cases) dependencies cannot be fulfilled and apt-get
    may choose an unwanted solution.
    
    Signed-off-by: Andreas Beckmann <debian at abeckmann.de>

diff --git a/debian/changelog b/debian/changelog
index 7ad68e2..5d36b23 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -13,6 +13,7 @@ piuparts (0.44) UNRELEASED; urgency=low
     - Add to self.ignored_patterns: /var/lib/ucf/.*
     - Increase output limit to 3 MB (for dist-upgrading daptup).
     - Do not miss Pre-Depends in --warn-on-others mode.
+    - Remove packages and reinstall missing ones in one apt-get call.
   * piuparts-report.py:
     - Add link to the list of untestable logs.
     - Add more known problem reports: forgotten alternatives, warnings in
diff --git a/piuparts.py b/piuparts.py
index 08e3609..4679cdb 100644
--- a/piuparts.py
+++ b/piuparts.py
@@ -1097,16 +1097,14 @@ class Chroot:
         # Run custom scripts before removing all packages. 
         self.run_scripts("pre_remove")
 
-        # First remove all packages.
+        # First remove all packages (and reinstall missing ones).
         self.remove_packages(deps_to_remove + deps_to_purge +
-                             nondeps_to_remove + nondeps_to_purge)
+                             nondeps_to_remove + nondeps_to_purge +
+                             ["%s+" % x for x in deps_to_install])
+
         # Run custom scripts after removing all packages. 
         self.run_scripts("post_remove")
 
-        # Then reinstall missing packages.
-        if deps_to_install:
-            self.install_packages_by_name(deps_to_install)
-
         if not settings.skip_cronfiles_test:
             cronfiles, cronfiles_list = self.check_if_cronfiles(packages)
 

-- 
piuparts git repository



More information about the Piuparts-commits mailing list