[Piuparts-commits] [SCM] piuparts git repository branch, piatti, updated. 0.48-55-gc89d173

Andreas Beckmann debian at abeckmann.de
Thu Dec 20 19:12:25 UTC 2012


The following commit has been merged in the piatti branch:
commit 3c06234ad7770412fe033e55d48af7a41ce1345b
Author: Andreas Beckmann <debian at abeckmann.de>
Date:   Sun Dec 16 22:35:10 2012 +0100

    p: add --distupgrade-to-testdebs option
    
    Do a distupgrade, but install the packages from the testdebs repository
    instead of the packages from the target distribution.
    
    Signed-off-by: Andreas Beckmann <debian at abeckmann.de>

diff --git a/debian/changelog b/debian/changelog
index 2cb334c..790e365 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -20,6 +20,9 @@ piuparts (0.49) UNRELEASED; urgency=low
       to be tested (and additional dependencies that are not yet in the
       archive) in a repository to enable dependency resolution with apt-get.
       Use for complex install and upgrade scenarios.
+    - Add --distupgrade-to-testdebs option. During distupgrade tests override
+      packages from the target distro with the packages from the testdebs
+      repository. This allows doing distupgrade tests before uploading.
   * piuparts.conf:
   * piupartslib/conf.py:
     - Add get_final_distro() method.
diff --git a/piuparts.1.txt b/piuparts.1.txt
index 0e29186..26a6406 100644
--- a/piuparts.1.txt
+++ b/piuparts.1.txt
@@ -76,6 +76,11 @@ The tarball can be created with the '-s' option, or you can use one that *pbuild
   a new one with debootstrap. This is similar to '--basetgz', but the contents
   are not archived.
 
+*--distupgrade-to-testdebs*::
+  Use the "testdebs" repository to override the packages in the distupgrade
+  target distribution. This allows to test complex upgrade paths before the
+  packages enter the archive.
+
 *--extra-repo*='deb-line'::
   Provide an additional (unparsed) line to be appended to sources.list, e.g.
     'deb <URL> <distrib> <components>' or
diff --git a/piuparts.py b/piuparts.py
index d0998e3..c9b792c 100644
--- a/piuparts.py
+++ b/piuparts.py
@@ -170,6 +170,7 @@ class Settings:
         self.warn_broken_symlinks = True
         self.warn_on_others = False
         self.warn_on_leftovers_after_purge = False
+        self.distupgrade_to_testdebs = False
         self.ignored_files = [
             # piuparts state
             "/usr/sbin/policy-rc.d",
@@ -2365,14 +2366,23 @@ def install_and_upgrade_between_distros(package_files, packages_qualified):
     os.environ["PIUPARTS_PHASE"] = "distupgrade"
 
     chroot.upgrade_to_distros(settings.debian_distros[1:-1], distupgrade_packages)
+
+    if settings.distupgrade_to_testdebs:
+        chroot.enable_testdebs_repo(update=False)
+
     chroot.upgrade_to_distros(settings.debian_distros[-1:], distupgrade_packages)
 
     chroot.check_for_no_processes()
 
     os.environ["PIUPARTS_PHASE"] = "upgrade"
 
+    if not settings.distupgrade_to_testdebs:
+        chroot.enable_testdebs_repo()
+
     chroot.install_packages(package_files, [p for p in packages_qualified if not p.endswith("=None")])
 
+    chroot.disable_testdebs_repo()
+
     chroot.check_for_no_processes()
 
     file_owners = chroot.get_files_owned_by_packages()
@@ -2480,6 +2490,10 @@ def parse_command_line():
                       action='store_true',
                       help="Do not verify signatures from the Release files when running debootstrap.")
 
+    parser.add_option("--distupgrade-to-testdebs", default=False,
+                      action='store_true',
+                      help="Use the testdebs repository as distupgrade target.")
+
     parser.add_option("-e", "--existing-chroot", metavar="DIR",
                       help="Use DIR as the contents of the initial " +
                            "chroot, instead of building a new one with " +
@@ -2721,6 +2735,7 @@ def parse_command_line():
     settings.pedantic_purge_test = opts.pedantic_purge_test
     if not settings.pedantic_purge_test:
       settings.ignored_patterns += settings.non_pedantic_ignore_patterns
+    settings.distupgrade_to_testdebs = opts.distupgrade_to_testdebs
 
     settings.extra_repos = opts.extra_repo
     settings.testdebs_repo = opts.testdebs_repo

-- 
piuparts git repository



More information about the Piuparts-commits mailing list