[Piuparts-commits] [SCM] piuparts git repository branch, develop, updated. 4493688c436272828f2ef731608cd0d802ea390f

Andreas Beckmann debian at abeckmann.de
Fri Dec 9 11:29:57 UTC 2011


The following commit has been merged in the develop branch:
commit 2c371db3cb2339c555e91974ad1bb26314d9205c
Author: Andreas Beckmann <debian at abeckmann.de>
Date:   Wed Dec 7 02:07:08 2011 +0100

    add --extra-old-packages option
    
    Some old packages may be no longer available in the new package set due to
    merges, reorganisation, ... and usually have Conflicts/Replaces in some
    new packages that will get installed.  To test that this works well, these
    old packages will be installed along with the old set if they are found by
    get_known_packages().
    --extra-old-packages takes a comma separated list of package names and/or
    can be given multiple times.
    
    Signed-off-by: Andreas Beckmann <debian at abeckmann.de>

diff --git a/debian/changelog b/debian/changelog
index 177973d..97f7122 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -86,6 +86,10 @@ piuparts (0.42) UNRELEASED; urgency=low
       all packages exist in the start distribution.  This happens e.g. when
       testing .changes files and packages were split/added. Only install the
       old packages that actually exist according to 'apt-cache show'.
+    - Add --extra-old-packages option to intall additional old packages that
+      are not in the set of new packages to be tested.  Useful for testing
+      upgrades with Conflicts/Replaces relationships, e.g. in package renames
+      or merges.
     - Use consistent variable names for package lists.  (Closes: #648177)
     - Compute the changes in restore_selections().
     - Check for settings.scriptsdir inside run_scripts().
diff --git a/piuparts.1.txt b/piuparts.1.txt
index f2da432..8548fee 100644
--- a/piuparts.1.txt
+++ b/piuparts.1.txt
@@ -68,6 +68,9 @@ The tarball can be created with the '-s' option, or you can use one that *pbuild
 *--no-eatmydata*::
   Prevent use of eatmydata.
 
+*--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.
+
 *-i* 'filename', *--ignore*='filename'::
   Add a filename to the list of filenames to be ignored when comparing changes before and after installation. By default, piuparts ignores files that always change during a package installation and uninstallation, such as *dpkg* status files. The filename should be relative to the root of the chroot (e.g., _var/lib/dpkg/status_). This option can be used as many times as necessary.
 
@@ -228,5 +231,5 @@ Lars Wirzenius (liw at iki.fi) and others
 
 DATE
 ----
-2009-12-08
+2011-12-06
 
diff --git a/piuparts.py b/piuparts.py
index b2c74d4..904b6cc 100644
--- a/piuparts.py
+++ b/piuparts.py
@@ -152,6 +152,7 @@ class Settings:
         self.list_installed_files = False
         self.no_install_purge_test = False
         self.no_upgrade_test = False
+        self.extra_old_packages = []
         self.skip_cronfiles_test = False
         self.skip_logrotatefiles_test = False
         self.check_broken_diversions = True
@@ -934,8 +935,9 @@ class Chroot:
             # and installing that would require removing the old version
             # of the library, and we've told apt-get not to remove
             # packages. So, we force the installation like this.
-            known_packages = self.get_known_packages(packages)
-            self.install_packages_by_name(known_packages)
+            if packages:
+                known_packages = self.get_known_packages(packages + settings.extra_old_packages)
+                self.install_packages_by_name(known_packages)
             # Run custom scripts after upgrade
             self.run_scripts("post_distupgrade")
             self.check_for_no_processes()
@@ -2109,7 +2111,7 @@ def install_and_upgrade_between_distros(package_files, packages):
 
     os.environ["PIUPARTS_PHASE"] = "install"
 
-    known_packages = chroot.get_known_packages(packages)
+    known_packages = chroot.get_known_packages(packages + settings.extra_old_packages)
     chroot.install_packages_by_name(known_packages)
 
     chroot.check_for_no_processes()
@@ -2301,6 +2303,12 @@ def parse_command_line():
                       action="store_true", default=False,
                       help="Skip install and purge test.")
 
+    parser.add_option("--extra-old-packages",
+                      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.")
+
     parser.add_option("-p", "--pbuilder", action="callback",
                       callback=set_basetgz_to_pbuilder,
                       help="Use /var/cache/pbuilder/base.tgz as the base " +
@@ -2397,6 +2405,7 @@ def parse_command_line():
     settings.list_installed_files = opts.list_installed_files
     settings.no_install_purge_test = opts.no_install_purge_test
     settings.no_upgrade_test = opts.no_upgrade_test
+    [settings.extra_old_packages.extend([i.strip() for i in csv.split(",")]) for csv in opts.extra_old_packages]
     settings.skip_cronfiles_test = opts.skip_cronfiles_test
     settings.skip_logrotatefiles_test = opts.skip_logrotatefiles_test
     settings.keyring = opts.keyring
@@ -2524,6 +2533,7 @@ def process_packages(package_list):
                 logging.info("Can't test upgrades: -a or --apt option used.")
             else:
                 packages_to_query = packages[:]
+                packages_to_query.extend(settings.extra_old_packages)
                 known_packages = chroot.get_known_packages(packages_to_query)
                 if not known_packages:
                     logging.info("Can't test upgrade: packages not known by apt-get.")

-- 
piuparts git repository



More information about the Piuparts-commits mailing list