[Piuparts-commits] [SCM] piuparts git repository branch, develop, updated. 0.44-612-g90378d6

Andreas Beckmann debian at abeckmann.de
Thu May 31 19:11:19 UTC 2012


The following commit has been merged in the develop branch:
commit cedf741cf560d1622accf0843fd4cf55745dfee3
Author: Andreas Beckmann <debian at abeckmann.de>
Date:   Thu May 31 12:56:24 2012 +0200

    p: save_meta_data: store directory names with a trailing '/'
    
    This will allow having ignore entries/patterns matching
    specifically on directories.
    Strip this slash while checking file ownership.
    
    Signed-off-by: Andreas Beckmann <debian at abeckmann.de>

diff --git a/debian/changelog b/debian/changelog
index 9c91e13..938ea3c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -28,6 +28,7 @@ piuparts (0.45) UNRELEASED; urgency=low
       config-files-remaining state.  (Closes: #359154)
     - Report leftover symlinks with target.
     - Report leftover directories with a trailing slash.
+    - Allow ignore entries to specifically match directories.
   * piupartslib/packagesdb.py:
     - Do not consider a package as "untestable" if untestable/ contains a
       logfile from an obsolete version of that package.
diff --git a/piuparts.py b/piuparts.py
index e298b93..715bd17 100644
--- a/piuparts.py
+++ b/piuparts.py
@@ -1128,6 +1128,8 @@ class Chroot:
                     target = os.readlink(name)
                 else:
                     target = None
+                    if stat.S_ISDIR(st.st_mode):
+                        name += "/"
                 vdict[name[len(root):]] = (st, target)
         return vdict
 
@@ -1720,11 +1722,12 @@ def file_list(meta_infos, file_owners):
         info = ""
         if target is not None:
             info = " -> %s" % target
-        elif stat.S_ISDIR(st.st_mode):
-            info = "/"
         vlist.append("  %s%s\t" % (name, info))
-        if name in file_owners:
-            vlist.append(" owned by: %s\n" % ", ".join(file_owners[name]))
+        key = name
+        if key.endswith('/'):
+            key = key[:-1]
+        if key in file_owners:
+            vlist.append(" owned by: %s\n" % ", ".join(file_owners[key]))
         else:
             vlist.append(" not owned\n")        
 

-- 
piuparts git repository



More information about the Piuparts-commits mailing list