[diffoscope] 08/09: Fix comparisons of directory with broken symlinks

Jérémy Bobbio lunar at moszumanska.debian.org
Tue Jan 19 18:22:31 CET 2016


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

lunar pushed a commit to branch master
in repository diffoscope.

commit 53cd31bf9eaa5270ddfe75e66a8596c777220c3f
Author: Jérémy Bobbio <lunar at debian.org>
Date:   Tue Jan 19 15:09:37 2016 +0000

    Fix comparisons of directory with broken symlinks
    
    Thanks Tuomas Tynkkynen for reporting the issue.
    
    Closes: #810825
---
 diffoscope/comparators/directory.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/diffoscope/comparators/directory.py b/diffoscope/comparators/directory.py
index a27745e..63ae4a7 100644
--- a/diffoscope/comparators/directory.py
+++ b/diffoscope/comparators/directory.py
@@ -82,6 +82,8 @@ def compare_meta(path1, path2):
         differences.append(Difference.from_command(Stat, path1, path2))
     except RequiredToolNotFound:
         logger.warn("'stat' not found! Is PATH wrong?")
+    if os.path.islink(path1) or os.path.islink(path2):
+        return [d for d in differences if d is not None]
     try:
         lsattr1 = lsattr(path1)
         lsattr2 = lsattr(path2)
@@ -171,4 +173,4 @@ class DirectoryContainer(Container):
         return names
 
     def get_member(self, member_name):
-        return FilesystemFile(os.path.join(self.source.path, member_name))
+        return diffoscope.comparators.specialize(FilesystemFile(os.path.join(self.source.path, member_name)))

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


More information about the diffoscope mailing list