[Piuparts-commits] [SCM] piuparts git repository branch, piatti, updated. 0.49-105-gac1319a

Andreas Beckmann anbe at debian.org
Fri Mar 1 15:32:55 UTC 2013


The following commit has been merged in the piatti branch:
commit 38ee6331b492d016292a219a270325841f8d87df
Author: Andreas Beckmann <anbe at debian.org>
Date:   Sun Feb 10 13:21:49 2013 +0100

    p: improve the "dirname part contains a symlink" test
    
    improve output to include name of overwritten package, if any,
    and report these as failures
    
    Signed-off-by: Andreas Beckmann <anbe at debian.org>

diff --git a/debian/changelog b/debian/changelog
index 05ef9b3..0067757 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,8 @@ piuparts (0.50) UNRELEASED; urgency=low
     - Pass unqualified package names to apt-cache show for lenny support.
     - Support plain URLs or local paths as --testdebs-repo argument and
       prepend/append "deb", "file://", and "./" as needed.
+    - Improve the "dirname part contains a symlink" test and report
+      overwritten files owned by other packages as failures.
   * piuparts.conf:
     - New global setting slave-directory.
   * piupartslib/conf.py:
diff --git a/known_problems/installs_over_symlink_error.conf b/known_problems/installs_over_symlink_error.conf
index 2f0a62d..d369428 100644
--- a/known_problems/installs_over_symlink_error.conf
+++ b/known_problems/installs_over_symlink_error.conf
@@ -1,7 +1,7 @@
 #
 # detect packages which have the string "dirname part contains a symlink" in their logs
 #
-COMMAND='grep "dirname part contains a symlink"'
+COMMAND='grep -E "silently overwrites files via directory symlinks|dirname part contains a symlink"'
 WHERE='fail bugged affected'
 ISSUE=0
 HEADER='Packages that install something over existing symlinks'
diff --git a/known_problems/installs_over_symlink_issue.conf b/known_problems/installs_over_symlink_issue.conf
index b080fac..130727b 100644
--- a/known_problems/installs_over_symlink_issue.conf
+++ b/known_problems/installs_over_symlink_issue.conf
@@ -1,7 +1,7 @@
 #
 # detect packages which have the string "dirname part contains a symlink" in their logs
 #
-COMMAND='grep "dirname part contains a symlink"'
+COMMAND='grep -E "silently overwrites files via directory symlinks|dirname part contains a symlink"'
 WHERE='pass'
 ISSUE=1
 HEADER='Packages that install something over existing symlinks'
diff --git a/piuparts.py b/piuparts.py
index 70e8ed7..50d259e 100644
--- a/piuparts.py
+++ b/piuparts.py
@@ -1206,14 +1206,26 @@ class Chroot:
     def list_paths_with_symlinks(self):
         file_owners = self.get_files_owned_by_packages()
         bad = []
+        overwrites = False
         for f in sorted(file_owners.keys()):
             dn, fn = os.path.split(f)
             dc = canonicalize_path(self.name, dn)
             if dn != dc:
-                bad.append("%s != %s (%s)" %(f, os.path.join(dc, fn), ", ".join(file_owners[f])))
+                fc = os.path.join(dc, fn)
+                of = ", ".join(file_owners[f])
+                if fc in file_owners:
+                    overwrites = True
+                    ofc = ", ".join(file_owners[fc])
+                else:
+                    ofc = "?"
+                bad.append("%s (%s) != %s (%s)" %(f, of, fc, ofc))
         if bad:
-            logging.info("dirname part contains a symlink:\n%s" %
-                         indent_string("\n".join(bad)))
+            if overwrites:
+                logging.error("FAIL: silently overwrites files via directory symlinks:\n" +
+                        indent_string("\n".join(bad)))
+            else:
+                logging.info("dirname part contains a symlink:\n" +
+                        indent_string("\n".join(bad)))
 
     def remove_packages(self, packages):
         """Remove packages in a chroot."""

-- 
piuparts git repository



More information about the Piuparts-commits mailing list