Hi again,
> diffoscope: walks through packages twice when comparing two .changes
(Cleaner version attached)
Regards,
--
,''`.
: :' : Chris Lamb
`. `'` [email protected] / chris-lamb.co.uk
`-
>From 2d2fc6377c635cdc5c9281bbd59d89f9563bef60 Mon Sep 17 00:00:00 2001
From: Chris Lamb <[email protected]>
Date: Wed, 21 Dec 2016 23:06:48 +0000
Subject: [PATCH] Avoid walking through packages twice when comparing two
.changes (Closes: #843531)
Signed-off-by: Chris Lamb <[email protected]>
---
diffoscope/comparators/debian.py | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/diffoscope/comparators/debian.py b/diffoscope/comparators/debian.py
index fa02064..67d74cb 100644
--- a/diffoscope/comparators/debian.py
+++ b/diffoscope/comparators/debian.py
@@ -181,8 +181,18 @@ class DotDscFile(DebControlFile):
file._deb822 = dsc
return True
+class DotBuildinfoContainer(DebControlContainer):
+ def get_member_names(self):
+ # If path exists in the parent container, don't recurse
+ parent_container_names = self.source.container.get_member_names()
+
+ return [
+ x for x in super(DotBuildinfoContainer, self).get_member_names()
+ if x not in parent_container_names
+ ]
class DotBuildinfoFile(DebControlFile):
+ CONTAINER_CLASS = DotBuildinfoContainer
RE_FILE_EXTENSION = re.compile(r'\.buildinfo$')
@staticmethod
--
2.11.0