[devscripts] 01/02: reproducible-check: Optionally support coloured terminal output.

Chris Lamb chris at chris-lamb.co.uk
Thu Sep 14 21:33:55 UTC 2017


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

lamby pushed a commit to branch master
in repository devscripts.

commit ef350bc58f8989b5f2f27083cccbc8ea5c54be7b
Author: Chris Lamb <lamby at debian.org>
Date:   Thu Sep 14 22:33:16 2017 +0100

    reproducible-check: Optionally support coloured terminal output.
---
 debian/control             |  1 +
 scripts/reproducible-check | 17 +++++++++++++----
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/debian/control b/debian/control
index 07f8b8a..328ae77 100644
--- a/debian/control
+++ b/debian/control
@@ -114,6 +114,7 @@ Suggests: adequate,
           mozilla-devscripts,
           mutt,
           piuparts,
+          python3-termcolor,
           quilt,
           ratt,
           reprotest,
diff --git a/scripts/reproducible-check b/scripts/reproducible-check
index f089b1e..b0d67bb 100755
--- a/scripts/reproducible-check
+++ b/scripts/reproducible-check
@@ -27,6 +27,12 @@ import collections
 
 from xdg.BaseDirectory import xdg_cache_home
 
+try:
+    from termcolor import colored
+except ImportError:
+    def colored(val, *args, **kwargs):
+        return val
+
 
 class ReproducibleCheck(object):
     HELP = """
@@ -142,15 +148,18 @@ class ReproducibleCheck(object):
         for key, binaries in sorted(unreproducible.items()):
             source, architecture, version = key
 
+            url = 'https://tests.reproducible-builds.org/debian/{}' \
+                .format(source)
             binaries_fmt = '({}) '.format(', '.join(binaries)) \
                 if binaries != [source] else ''
 
-            print("{} ({}) is unreproducible {}".format(
-                source,
+            print("{} {} ({}) is unreproducible {}<{}>".format(
+                colored('W:', 'red'),
+                colored(source, attrs=['bold']),
                 version,
                 binaries_fmt,
-            ), end='')
-            print("<https://tests.reproducible-builds.org/debian/{}>".format(source))
+                colored(url, attrs=['underline']),
+            ))
 
         print("{}/{} ({:.2f}%) of installed binary packages are unreproducible.".format(
             num_unreproducible,

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/devscripts.git



More information about the devscripts-devel mailing list