[Piuparts-commits] [piuparts] 01/01: Consider the /usr merge to be acceptable variation. (Closes: #860433)

Holger Levsen holger at layer-acht.org
Thu Sep 7 13:50:33 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 7e5c9994672007d50f728e146a9523b48f4aea66
Author: Simon McVittie <smcv at debian.org>
Date:   Thu Sep 7 15:48:04 2017 +0200

    Consider the /usr merge to be acceptable variation. (Closes: #860433)
    
    Consider the /usr merge to be acceptable variation. Files that the dpkg database considers to be in /bin, /sbin, /lib/**, /lib*/** are now allowed to be physically in /usr/bin, etc. due to symlinks in the root directory, as created by usrmerge or debootstrap --merged-usr. (Closes: #860433)
    
    Signed-off-by: Simon McVittie <smcv at debian.org>
    Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
 debian/changelog |  7 +++++++
 piuparts.py      | 16 ++++++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 7206fa5..6ef4672 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,13 @@ piuparts (0.81) UNRELEASED; urgency=medium
     sections that use scripts-log-alternatives.
   * Use copyright notices without FSF street address.
 
+  [ Simon McVittie ]
+  * Consider the /usr merge to be acceptable variation. Files that the
+    dpkg database considers to be in /bin, /sbin, /lib/**, /lib*/**
+    are now allowed to be physically in /usr/bin, etc. due to symlinks in
+    the root directory, as created by usrmerge or debootstrap --merged-usr.
+    (Closes: #860433)
+
  -- Holger Levsen <holger at debian.org>  Thu, 31 Aug 2017 17:41:08 +0200
 
 piuparts (0.80) unstable; urgency=medium
diff --git a/piuparts.py b/piuparts.py
index 3310cc4..5204193 100644
--- a/piuparts.py
+++ b/piuparts.py
@@ -1410,10 +1410,26 @@ class Chroot:
         file_owners = self.get_files_owned_by_packages()
         bad = []
         overwrites = False
+        usrmerge = set()
         for f in sorted(file_owners.keys()):
             dn, fn = os.path.split(f)
             dc = canonicalize_path(self.name, dn)
             if dn != dc:
+                # Allow the /usr merge to have taken place. For example, if
+                # f (the file recorded in the dpkg database) is /bin/cat,
+                # then dn is /bin, and it's OK for /bin to have become a
+                # symlink to /usr/bin. Similarly /sbin, /lib, /libQUAL
+                # (/lib32 etc.) or any subdirectory of /lib or /libQUAL
+                # can be /usr-merged.
+                if dc == '/usr' + dn and (dn in ('/bin', '/sbin') or
+                                          dn.startswith('/lib')):
+                    # Only report each directory once
+                    if dn not in usrmerge:
+                        usrmerge.add(dn)
+                        logging.info('%s converted to %s by /usr merge', dn, dc)
+
+                    continue
+
                 fc = os.path.join(dc, fn)
                 of = ", ".join(file_owners[f])
                 if fc in file_owners:

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