You did this, but actually the bug was already fixed (i.e. it wasn't broken by the "-dirty" suffix, but due to the output changing the order of the lines)<div>Nonetheless, I find your solution of using a regular expression superior to my guesswork, but I would have still considered the -dirty suffix relevant and part of the version.<br><br><div class="gmail_quote"><div dir="ltr">On Fri, 3 Nov 2017, 10:02 a.m. Chris Lamb, <<a href="mailto:chris@chris-lamb.co.uk">chris@chris-lamb.co.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This is an automated email from the git hooks/post-receive script.<br>
<br>
lamby pushed a commit to branch master<br>
in repository diffoscope.<br>
<br>
commit d4ce05062e0368549ffe34276233f48f9ab68900<br>
Author: Chris Lamb <<a href="mailto:lamby@debian.org" target="_blank">lamby@debian.org</a>><br>
Date:   Fri Nov 3 10:01:39 2017 +0100<br>
<br>
    test_dtb.py: Only parse the version number, not any "-dirty" suffix. (Closes: #880279)<br>
---<br>
 tests/comparators/test_dtb.py | 19 +++++++++++--------<br>
 1 file changed, 11 insertions(+), 8 deletions(-)<br>
<br>
diff --git a/tests/comparators/test_dtb.py b/tests/comparators/test_dtb.py<br>
index 635ff30..eeb5db6 100644<br>
--- a/tests/comparators/test_dtb.py<br>
+++ b/tests/comparators/test_dtb.py<br>
@@ -18,6 +18,7 @@<br>
 # You should have received a copy of the GNU General Public License<br>
 # along with diffoscope.  If not, see <<a href="https://www.gnu.org/licenses/" rel="noreferrer" target="_blank">https://www.gnu.org/licenses/</a>>.<br>
<br>
+import re<br>
 import pytest<br>
 import subprocess<br>
<br>
@@ -35,14 +36,16 @@ dtb2 = load_fixture('devicetree2.dtb')<br>
<br>
<br>
 def fdtdump_version():<br>
-    out = subprocess.check_output(('fdtdump', '--version'), stderr=subprocess.STDOUT)<br>
-    # We are looking for a line like<br>
-    #   Version: DTC 1.4.5<br>
-    # that usually is placed last<br>
-    for line in reversed(out.decode().splitlines()):<br>
-        if line.startswith('Version: '):<br>
-            return line.split()[2]<br>
-    raise ValueError('Error parsing `fdtdump --version` output')<br>
+    out = subprocess.check_output(<br>
+        ('fdtdump', '--version'),<br>
+        stderr=subprocess.STDOUT,<br>
+    ).decode('utf-8')<br>
+<br>
+    m = re.search(r'Version: DTC (?P<version>\d+\.\d+\.\d+)', out)<br>
+    if m is None:<br>
+        raise ValueError("Error parsing `fdtdump --version` output")<br>
+<br>
+    return m.group('version')<br>
<br>
<br>
 def test_identification(dtb1):<br>
<br>
--<br>
Alioth's /usr/local/bin/git-commit-notice on /srv/<a href="http://git.debian.org/git/reproducible/diffoscope.git" rel="noreferrer" target="_blank">git.debian.org/git/reproducible/diffoscope.git</a><br>
<br>
_______________________________________________<br>
Reproducible-commits mailing list<br>
<a href="mailto:Reproducible-commits@lists.alioth.debian.org" target="_blank">Reproducible-commits@lists.alioth.debian.org</a><br>
<a href="https://lists.alioth.debian.org/mailman/listinfo/reproducible-commits" rel="noreferrer" target="_blank">https://lists.alioth.debian.org/mailman/listinfo/reproducible-commits</a><br>
</blockquote></div></div>