[Piuparts-commits] [piuparts] 01/01: p: add --fake-essential-packages option

Holger Levsen holger at moszumanska.debian.org
Sat Jul 25 17:48:00 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 5077e27f635c9560ded4342f76d4d4b7ab0095e4
Author: Andreas Beckmann <anbe at debian.org>
Date:   Sat Jul 25 14:34:12 2015 +0200

    p: add --fake-essential-packages option
    
    Signed-off-by: Andreas Beckmann <anbe at debian.org>
---
 debian/changelog |  3 +++
 piuparts.py      | 11 +++++++++++
 2 files changed, 14 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index e69379e..adcd8c6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,9 @@ piuparts (0.65) UNRELEASED; urgency=medium
     - Ensure /etc/mtab exists in the chroot.
     - Create sources.list entries for --testdebs-repo with '[ trusted=yes ]'
       to avoid needing --do-not-verify-signatures which would act globally.
+    - Add --fake-essential-packages option to include packages to the base
+      chroot that are not removed after the test. These are available during
+      purge and for checking against mistreatment.
   * piuparts.conf.anbe: Add some more example sections.
   * piupartslib/packagesdb.py:
     - Put package in 'dependency-does-not-exist' state if a pass/ log exists
diff --git a/piuparts.py b/piuparts.py
index 2aad3ee..17ed2cf 100644
--- a/piuparts.py
+++ b/piuparts.py
@@ -188,6 +188,7 @@ class Settings:
         self.install_remove_install = False
         self.install_purge_install = False
         self.list_installed_files = False
+        self.fake_essential_packages = []
         self.extra_old_packages = []
         self.skip_cronfiles_test = False
         self.skip_logrotatefiles_test = False
@@ -755,6 +756,8 @@ class Chroot:
         # Run custom scripts after creating the chroot.
         self.run_scripts("post_setup")
 
+        self.install_packages_by_name(settings.fake_essential_packages)
+
         if settings.savetgz and not temp_tgz:
             self.pack_into_tgz(settings.savetgz)
 
@@ -2806,6 +2809,13 @@ def parse_command_line():
                       action="store_true", default=False,
                       help="Remove package after installation and reinstall. For testing installation in config-files-remaining state.")
 
+    parser.add_option("--fake-essential-packages",
+                      action="append", default=[],
+                      help="Install these additional packages in the base chroot. They won't be purged after the test. " +
+                      "Takes a comma separated list of package names and can be given multiple times. " +
+                      "Useful for packages that can be used during purge of the package to be tested " +
+                      "or to test if the package to be tested mishandles this package.")
+
     parser.add_option("--extra-old-packages",
                       action="append", default=[],
                       help="Install these additional packages along with the old packages from the archive. " +
@@ -2957,6 +2967,7 @@ def parse_command_line():
     settings.install_purge_install = opts.install_purge_install
     settings.install_remove_install = opts.install_remove_install
     settings.list_installed_files = opts.list_installed_files
+    [settings.fake_essential_packages.extend([i.strip() for i in csv.split(",")]) for csv in opts.fake_essential_packages]
     [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

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