From 20e40dd99e8fdd317eae4383a9f66667aece77c6 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Wed, 8 Oct 2014 18:11:56 +0200 Subject: reproducible: display nice status icon in package view --- bin/reproducible_stats.sh | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) (limited to 'bin/reproducible_stats.sh') diff --git a/bin/reproducible_stats.sh b/bin/reproducible_stats.sh index b30bfa2b..4ad224e9 100755 --- a/bin/reproducible_stats.sh +++ b/bin/reproducible_stats.sh @@ -88,9 +88,27 @@ EOF init_navi_frame() { echo "" > $NAVI echo "" >> $NAVI - echo "
$1 " >> $NAVI - echo "($2) " >> $NAVI - echo "at $3: " >> $NAVI + echo "
$1 $2" >> $NAVI + # icons taken from tango-icon-theme (0.8.90-5) + # licenced under http://creativecommons.org/licenses/publicdomain/ + case $3 in + reproducible) ICON=weather-clear.png + ;; + unreproducible) if [ "$5" != "" ] ; then + ICON=weather-showers-scattered.png + else + ICON=weather-showers.png + fi + ;; + FTBFS) ICON=weather-storm.png + ;; + 404) ICON=weather-severe-alert.png + ;; + "not for us") ICON=weather-few-clouds-night.png + ;; + esac + echo " $3" >> $NAVI + echo "at $4: " >> $NAVI } append2navi_frame() { @@ -103,9 +121,10 @@ finish_navi_frame() { process_packages() { for PKG in $@ ; do - RESULT=$(sqlite3 -init $INIT $PACKAGES_DB "SELECT build_date,version FROM source_packages WHERE name = \"$PKG\"") + RESULT=$(sqlite3 -init $INIT $PACKAGES_DB "SELECT build_date,version,status FROM source_packages WHERE name = \"$PKG\"") BUILD_DATE=$(echo $RESULT|cut -d "|" -f1) VERSION=$(echo $RESULT|cut -d "|" -f2) + STATUS=$(echo $RESULT|cut -d "|" -f3) # remove epoch EVERSION=$(echo $VERSION | cut -d ":" -f2) if $BUILDINFO_SIGNS && [ -f "/var/lib/jenkins/userContent/buildinfo/${PKG}_${EVERSION}_amd64.buildinfo" ] ; then @@ -116,7 +135,7 @@ process_packages() { FILE=$(find $(dirname $NAVI) -name $(basename $NAVI) ! -newermt "$BUILD_DATE" 2>/dev/null || true) if [ ! -f $NAVI ] || [ "$FILE" != "" ] ; then MAINLINK="" - init_navi_frame "$PKG" "$VERSION" "$BUILD_DATE" + init_navi_frame "$PKG" "$VERSION" "$STATUS" "$BUILD_DATE" "${STAR[$PKG]}" if [ -f "/var/lib/jenkins/userContent/buildinfo/${PKG}_${EVERSION}_amd64.buildinfo" ] ; then append2navi_frame " buildinfo " MAINLINK="$JENKINS_URL/userContent/buildinfo/${PKG}_${EVERSION}_amd64.buildinfo" -- cgit v1.2.3-70-g09d2