[Piuparts-commits] [SCM] piuparts git repository branch, master, updated. 0.51

Andreas Beckmann anbe at debian.org
Wed May 15 10:09:32 UTC 2013


The following commit has been merged in the master branch:
commit fb2ceac24a826ee4ea8d446b001543031f38ef4f
Author: Andreas Beckmann <anbe at debian.org>
Date:   Sun Mar 17 11:40:45 2013 +0100

    p: enable --extra-old-packages for install-purge test
    
    allow some additional packages to be installed *before* the package
    to be tested gets installed
    
    Signed-off-by: Andreas Beckmann <anbe at debian.org>

diff --git a/debian/changelog b/debian/changelog
index 9b19b02..c001502 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,8 @@ piuparts (0.51) UNRELEASED; urgency=low
 
   [ Andreas Beckmann ]
   * piuparts.py:
+    - In install-purge tests support installing extra packages before the
+      package to be tested via --extra-old-packages.
   * piuparts.conf:
   * distros.conf:
   * piupartslib/packagesdb.py:
diff --git a/piuparts.1.txt b/piuparts.1.txt
index f0d70e6..6a1d68e 100644
--- a/piuparts.1.txt
+++ b/piuparts.1.txt
@@ -70,6 +70,8 @@ The tarball can be created with the '-s' option, or you can use one that *pbuild
 
 *--extra-old-packages*='pkg1[,pkg2]...'::
   Install additional old packages before upgrading.  Allows testing package renames/merges where the old package is no longer available in the new distribution and the new one utilizes Conflicts/Replaces.  The argument is a comma separated list of package names and the option can be given multiple times.
+  For install/purge tests these packages will be installed before the package
+  that is to be tested.
 
 *-e* 'dirname', *--existing-chroot*='dirname'::
   Use the specified directory as source for the new chroot, instead of building
diff --git a/piuparts.py b/piuparts.py
index 2041135..a6710e0 100644
--- a/piuparts.py
+++ b/piuparts.py
@@ -2157,7 +2157,7 @@ def check_results(chroot, chroot_state, file_owners, deps_info=None):
     return ok
 
 
-def install_purge_test(chroot, chroot_state, package_files, packages):
+def install_purge_test(chroot, chroot_state, package_files, packages, extra_packages):
     """Do an install-purge test. Return True if successful, False if not.
        Assume 'root' is a directory already populated with a working
        chroot, with packages in states given by 'selections'."""
@@ -2174,6 +2174,8 @@ def install_purge_test(chroot, chroot_state, package_files, packages):
 
     chroot.run_scripts("pre_install")
 
+    chroot.install_packages([], extra_packages, with_scripts=False)
+
     if settings.warn_on_others or settings.install_purge_install:
         # Create a metapackage with dependencies from the given packages
         if package_files:
@@ -2648,7 +2650,8 @@ def parse_command_line():
                       action="append", default=[],
                       help="Install these additional packages along with the old packages from the archive. " +
                       "Useful to test Conflicts/Replaces of packages that will disappear during the update. " +
-                      "Takes a comma separated list of package names and can be given multiple times.")
+                      "Takes a comma separated list of package names and can be given multiple times. " +
+                      "For install/purge tests these packages will be installed before the package that is to be tested.")
 
     parser.add_option("-p", "--pbuilder", action="callback",
                       callback=set_basetgz_to_pbuilder,
@@ -2889,8 +2892,9 @@ def process_packages(package_list):
         chroot_state["diversions"] = chroot.get_diversions()
 
         if not settings.no_install_purge_test:
+            extra_packages = chroot.get_known_packages(settings.extra_old_packages)
             if not install_purge_test(chroot, chroot_state,
-                      package_files, packages):
+                      package_files, packages, extra_packages):
                 logging.error("FAIL: Installation and purging test.")
                 panic()
             logging.info("PASS: Installation and purging test.")

-- 
piuparts git repository



More information about the Piuparts-commits mailing list