[diffoscope] 01/04: comparators/directory: raise warning for getfacl and remove a redundant try-clause

Ximin Luo infinity0 at debian.org
Fri Jun 30 19:12:28 CEST 2017


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

infinity0 pushed a commit to branch master
in repository diffoscope.

commit 037c92388ef75d5ace2d26dd85bcf7693ccf7cf6
Author: Ximin Luo <infinity0 at debian.org>
Date:   Fri Jun 30 17:56:57 2017 +0200

    comparators/directory: raise warning for getfacl and remove a redundant try-clause
---
 diffoscope/comparators/directory.py | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/diffoscope/comparators/directory.py b/diffoscope/comparators/directory.py
index 8497264..5235709 100644
--- a/diffoscope/comparators/directory.py
+++ b/diffoscope/comparators/directory.py
@@ -114,11 +114,11 @@ def compare_meta(path1, path2):
         differences.append(Difference.from_text(
                                lsattr1, lsattr2, path1, path2, source="lsattr"))
     except RequiredToolNotFound:
-        logger.info("Unable to find 'lsattr'.")
+        logger.info("Unable to find 'lsattr', some directory metadata differences might not be noticed.")
     try:
         differences.append(Difference.from_command(Getfacl, path1, path2))
     except RequiredToolNotFound:
-        logger.info("Unable to find 'getfacl'.")
+        logger.warning("Unable to find 'getfacl', some directory metadata differences might not be noticed.")
     return [d for d in differences if d is not None]
 
 
@@ -159,14 +159,11 @@ class FilesystemDirectory(Directory):
 
     def compare(self, other, source=None):
         differences = []
-        try:
-            listing_diff = Difference.from_text('\n'.join(list_files(self.path)),
-                                                '\n'.join(list_files(other.path)),
-                                                self.path, other.path, source='file list')
-            if listing_diff:
-                differences.append(listing_diff)
-        except RequiredToolNotFound:
-            logger.info("Unable to find 'getfacl'.")
+        listing_diff = Difference.from_text('\n'.join(list_files(self.path)),
+                                            '\n'.join(list_files(other.path)),
+                                            self.path, other.path, source='file list')
+        if listing_diff:
+            differences.append(listing_diff)
         differences.extend(compare_meta(self.name, other.name))
 
         my_container = DirectoryContainer(self)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git


More information about the diffoscope mailing list