[Piuparts-commits] [piuparts] 09/09: p: restore the package versions from the reference chroot

Holger Levsen holger at moszumanska.debian.org
Sat May 16 14:51:33 UTC 2015


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

holger pushed a commit to branch develop
in repository piuparts.

commit 7b3dfe0a7a57abab3e8743d3ef3baa6008278315
Author: Andreas Beckmann <anbe at debian.org>
Date:   Tue May 5 00:08:58 2015 +0200

    p: restore the package versions from the reference chroot
    
    in case there are more versions available (e.g. in sid+experimental)
    and our installation test caused some packages in the reference chroot
    to be upgraded
    
    Signed-off-by: Andreas Beckmann <anbe at debian.org>
---
 debian/changelog |  7 +++++--
 piuparts.py      | 16 +++++++++++-----
 2 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 0c2e689..b26fe38 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,5 @@
 piuparts (0.64) UNRELEASED; urgency=medium
- 
+
   [ Holger Levsen ]
   * Add FancyIndexing to piuparts-master.conf and enable apache syntax
     highlighting in vim. (Thanks DSA!)
@@ -8,6 +8,9 @@ piuparts (0.64) UNRELEASED; urgency=medium
   * piuparts.py:
     - Use 'dpkg-query -W' instead of 'dpkg --get-selections' to record
       architecture and version information for installed packages, too.
+    - Restore the selections to the package versions from the reference chroot
+      in scenarios like sid+experimental where more than one version could be
+      available. Use --force-yes since this may involve downgrades.
   * piuparts.conf:
     - New global setting: basetgz-sections, used by piuparts-slave only.
     - Switch to separate tarball sections.
@@ -87,7 +90,7 @@ piuparts (0.63) unstable; urgency=medium
   * test_config.py: update for Jessie being stable and Stretch being the new
     testing suite.
   * debian/copyright: Remove space from W3C FreeUse licence name, thanks
-    lintian. 
+    lintian.
   * Update piuparts.py, piuparts.1.txt and README_server.txt due to the fact
     that jessie is the new stable and testing is stretch now.
 
diff --git a/piuparts.py b/piuparts.py
index 4e922ac..fe4f6bd 100644
--- a/piuparts.py
+++ b/piuparts.py
@@ -1355,9 +1355,11 @@ class Chroot:
                              if state == "remove"]
         nondeps_to_purge = [name for name, (state, version) in nondeps.iteritems()
                             if state == "purge"]
-        deps_to_install = [name for name, (state, version) in deps.iteritems()
-                           if state == "install"]
         all_to_remove = deps_to_remove + deps_to_purge + nondeps_to_remove + nondeps_to_purge
+        all_to_install = [(name, version) for name, (state, version) in deps.iteritems()
+                          if state == "install"]
+        all_to_install += [(name, version) for name, (state, version) in nondeps.iteritems()
+                           if state == "install"]
 
         self.list_paths_with_symlinks()
         self.check_debsums()
@@ -1368,10 +1370,14 @@ class Chroot:
 
         # First remove all packages (and reinstall missing ones).
         self.remove_packages(deps_to_remove)
-        if deps_to_install:
+        if all_to_install:
+            version_qualified = [name for (name, version) in all_to_install
+                                 if version is None]
+            version_qualified += ["%s=%s" % (name, version) for (name, version) in all_to_install
+                                  if version is not None]
             self.apt_get_install(to_remove=all_to_remove,
-                                 to_install=deps_to_install,
-                                 flags=["--no-install-recommends"])
+                                 to_install=version_qualified,
+                                 flags=["--no-install-recommends", "--force-yes"])
         else:
             self.remove_packages(all_to_remove)
 

-- 
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