[diffoscope] 04/05: Output --list-tools in RFC822 format to make parsing less brittle.

Chris Lamb chris at chris-lamb.co.uk
Sat Aug 13 21:02:23 CEST 2016


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

lamby pushed a commit to branch master
in repository diffoscope.

commit 173f58f8a888a45df838e717717eaddb617f0f3e
Author: Chris Lamb <lamby at debian.org>
Date:   Sat Aug 13 19:58:39 2016 +0100

    Output --list-tools in RFC822 format to make parsing less brittle.
---
 debian/rules       | 2 +-
 diffoscope/main.py | 5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/debian/rules b/debian/rules
index 2b58a4f..43a7477 100755
--- a/debian/rules
+++ b/debian/rules
@@ -22,7 +22,7 @@ override_dh_python3:
 		--recommends=argcomplete
 
 override_dh_gencontrol:
-	TOOLS="$$(bin/diffoscope --list-tools=debian | tail -n 1 | \
+	TOOLS="$$(bin/diffoscope --list-tools=debian | awk -F': ' '/Available-in-Debian-packages/ { print $$2 }' | \
 		sed -e 's/\(^\| \)\(coreutils\|diffutils\|e2fsprogs\|findutils\|gzip\|tar\)\(,\|$$\)//g')"; \
 		[ -n "$$TOOLS" ] || { echo '--list-tools failed' >&2; exit 1; }; \
 		echo "diffoscope:Recommends=$$TOOLS" >> debian/diffoscope.substvars
diff --git a/diffoscope/main.py b/diffoscope/main.py
index 9213bf0..94ef452 100644
--- a/diffoscope/main.py
+++ b/diffoscope/main.py
@@ -132,7 +132,7 @@ class ListToolsAction(argparse.Action):
     def __call__(self, parser, namespace, os_override, option_string=None):
         from functools import reduce
         from diffoscope import tool_required, RequiredToolNotFound, OS_NAMES, get_current_os
-        print("External tools required:")
+        print("External-Tools-Required: ", end='')
         print(', '.join(sorted(tool_required.all)))
         if os_override:
             if os_override in OS_NAMES.keys():
@@ -148,8 +148,7 @@ class ListToolsAction(argparse.Action):
             else:
                 os_list = OS_NAMES.keys()
         for os in os_list:
-            print()
-            print("Available in {} packages: ".format(OS_NAMES.get(os, os)))
+            print("Available-in-{}-packages: ".format(OS_NAMES.get(os, os)), end='')
             print(', '.join(sorted(filter(None, { RequiredToolNotFound.PROVIDERS.get(k, {}).get(os, None) for k in tool_required.all }))))
         sys.exit(0)
 

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


More information about the diffoscope mailing list