[Reproducible-commits] [misc] 01/01: reports/bin/history: rewrite to be more nice and lovely :)
Mattia Rizzolo
mattia at mapreri.org
Sun Sep 13 07:41:08 UTC 2015
This is an automated email from the git hooks/post-receive script.
mapreri-guest pushed a commit to branch master
in repository misc.
commit 07525d5a243f7b7c55594f77793a735cf74fc0b6
Author: Mattia Rizzolo <mattia at mapreri.org>
Date: Sun Sep 13 07:40:54 2015 +0000
reports/bin/history: rewrite to be more nice and lovely :)
---
reports/bin/history | 27 ++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
diff --git a/reports/bin/history b/reports/bin/history
index 1637d8a..f480fd9 100755
--- a/reports/bin/history
+++ b/reports/bin/history
@@ -2,6 +2,31 @@
# history: look at the history of reproducibly test for a package
#
# Copyright © 2015 Lunar <lunar at debian.org>
+# © 2015 Mattia Rizzolo <mattia at mapreri.org>
# Licensed under WTFPL — http://www.wtfpl.net/txt/copying/
-sqlite3 reproducible.db "SELECT * FROM stats_build WHERE name = '$1' AND suite = '${2:-unstable}' ORDER BY build_date;"
+if [ -n "$1" ]; then
+ PACKAGE=$1
+else
+ echo "Please provide a package name as a first parameter to this script"
+ exit 1
+fi
+
+if [ -n "$2" ]; then
+ SUITE=" AND suite='$2' "
+fi
+
+DB="${DB:-reproducible.db}"
+SQLITE_OPTS="${SQLITE_OPTS:--column -header}"
+
+QUERY="SELECT * FROM stats_build WHERE name='$PACKAGE' $SUITE ORDER BY build_date"
+WIDTH="5 0 0 0 0 15 0 0 13"
+sqlite3 $SQLITE_OPTS -cmd ".width $WIDTH" "$DB" "$QUERY"
+
+
+printf "\n\n@@@@@ RESULTS @@@@@@\n"
+QUERY="SELECT s.id as 'pkg id', s.name, s.version, s.suite, s.architecture as arch, s.notify_maintainer, r.version as 'tested version', r.status, r.build_date, r.build_duration as duration, r.builder
+FROM sources AS s JOIN results AS r ON r.package_id=s.id WHERE s.name='$PACKAGE'"
+WIDTH="6 0 0 0 5 0 0 0 16 0 13"
+RESULT="$(sqlite3 $SQLITE_OPTS -cmd ".width $WIDTH" "$DB" "$QUERY" 2> /dev/null)"
+if [ ! -z "$RESULT" ] ; then echo "$RESULT" ; else echo "$PACKAGE has not been built yet" ; fi
--
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