[Reproducible-commits] [misc] 01/02: reports: history: Output colors in summary mode
Ximin Luo
infinity0 at debian.org
Mon Aug 8 19:24:07 UTC 2016
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch master
in repository misc.
commit 2a754b79e71d8a3e81f16cf1c6dd988be3d42988
Author: Ximin Luo <infinity0 at debian.org>
Date: Mon Aug 8 21:18:23 2016 +0200
reports: history: Output colors in summary mode
---
reports/bin/history | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/reports/bin/history b/reports/bin/history
index d5be590..350d90f 100755
--- a/reports/bin/history
+++ b/reports/bin/history
@@ -58,8 +58,23 @@ if $full; then
QUERY="SELECT * FROM stats_build WHERE name='$PACKAGE' $FILTER ORDER BY build_date"
WIDTH="5 0 0 0 0 15 0 0 13"
else
- QUERY="SELECT name, version, suite, architecture AS arch, status, build_date FROM stats_build WHERE name='$PACKAGE' $FILTER ORDER BY build_date"
- WIDTH="0 25 0 7 6 13"
+ if tty -s; then
+ status="replace(\
+ replace(\
+ replace(\
+ replace(\
+ status,\
+ 'FTBFS', X'1B'||'[31mFTBFS'||X'1B'||'[0m'),\
+ 'unrepr', X'1B'||'[91munrepr'||X'1B'||'[0m'),\
+ 'depwai', X'1B'||'[93mdepwai'||X'1B'||'[0m'),\
+ 'reprod', X'1B'||'[92mreprod'||X'1B'||'[0m')"
+ swidth="15" # 6 + number of escape chars
+ else
+ status="status"
+ swidth="6"
+ fi
+ QUERY="SELECT name, version, suite, architecture AS arch, $status, build_date FROM stats_build WHERE name='$PACKAGE' $FILTER ORDER BY build_date"
+ WIDTH="0 25 0 7 $swidth 13"
fi
sqlite3 $SQLITE_OPTS -cmd ".width $WIDTH" "$DB" "$QUERY"
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/misc.git
More information about the Reproducible-commits
mailing list