[Piuparts-commits] [piuparts] 03/07: p: make install_over_symlink tests fail without --warn-on-install-over-symlink

Holger Levsen holger at layer-acht.org
Sun Feb 26 13:56:15 UTC 2017


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

holger pushed a commit to branch develop
in repository piuparts.

commit cd98694aba497fdff9ef5b023877bd97140b69fb
Author: Andreas Beckmann <anbe at debian.org>
Date:   Sun Feb 26 00:38:42 2017 +0100

    p: make install_over_symlink tests fail without --warn-on-install-over-symlink
    
    Signed-off-by: Andreas Beckmann <anbe at debian.org>
    Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
 debian/changelog | 3 +++
 piuparts.py      | 9 +++++++++
 2 files changed, 12 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 01e6b7c..75e4d7d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,9 @@
 piuparts (0.76) UNRELEASED; urgency=medium
 
   [ Andreas Beckmann ]
+  * piuparts.py:
+    - Make install_over_symlink tests fail by default, add
+      --warn-on-install-over-symlink option to demote this to a warning.
   * Clean up leftover /etc/piuparts/scripts/post_setup_experimental.
     (Closes: #854317)
   * scripts/pre_distupgrade_zz_database-server: Switch from mysql-server to
diff --git a/piuparts.py b/piuparts.py
index 30cfaa9..686a56f 100644
--- a/piuparts.py
+++ b/piuparts.py
@@ -207,6 +207,7 @@ class Settings:
         self.warn_on_others = False
         self.warn_on_leftovers_after_purge = False
         self.warn_on_debsums_errors = False
+        self.warn_on_install_over_symlink = False
         self.warn_if_inadequate = True
         self.pedantic_purge_test = False
         self.ignored_files = [
@@ -1403,6 +1404,8 @@ class Chroot:
             else:
                 logging.info("dirname part contains a symlink:\n" +
                              indent_string("\n".join(bad)))
+            if not settings.warn_on_install_over_symlink:
+                panic()
 
     def remove_packages(self, packages):
         """Remove packages in a chroot."""
@@ -3042,6 +3045,11 @@ def parse_command_line():
                       help="Print a warning rather than failing if "
                            "debsums reports modified files.")
 
+    parser.add_option("--warn-on-install-over-symlink",
+                      action="store_true", default=False,
+                      help="Print a warning rather than failing if "
+                           "files are installed over existing symlinks.")
+
     parser.add_option("--fail-if-inadequate",
                       action="store_true", default=False,
                       help="Fail on inadequate results from running adequate.")
@@ -3126,6 +3134,7 @@ def parse_command_line():
     settings.warn_on_others = opts.warn_on_others
     settings.warn_on_leftovers_after_purge = opts.warn_on_leftovers_after_purge
     settings.warn_on_debsums_errors = opts.warn_on_debsums_errors
+    settings.warn_on_install_over_symlink = opts.warn_on_install_over_symlink
     settings.warn_if_inadequate = not opts.fail_if_inadequate
     settings.pedantic_purge_test = opts.pedantic_purge_test
     settings.ignored_files += opts.ignore

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