From 8c45cfec0f501d0fecbebba9bb86064755fe7504 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Tue, 7 Oct 2014 18:16:12 +0200 Subject: reproducible: refactor, introduce associative array --- bin/reproducible_stats.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/bin/reproducible_stats.sh b/bin/reproducible_stats.sh index 1c4398f5..2bcfb132 100755 --- a/bin/reproducible_stats.sh +++ b/bin/reproducible_stats.sh @@ -37,6 +37,7 @@ PERCENT_UGLY=$(echo "scale=1 ; ($COUNT_UGLY*100/$COUNT_TOTAL)" | bc) PERCENT_NOTFORUS=$(echo "scale=1 ; ($COUNT_NOTFORUS*100/$COUNT_TOTAL)" | bc) PERCENT_SOURCELESS=$(echo "scale=1 ; ($COUNT_SOURCELESS*100/$COUNT_TOTAL)" | bc) GUESS_GOOD=$(echo "$PERCENT_GOOD*$AMOUNT/100" | bc) +declare -A STAR write_summary() { echo "$1" >> $SUMMARY @@ -82,9 +83,8 @@ link_packages() { VERSION=$(echo $RESULT|cut -d "|" -f2) # remove epoch EVERSION=$(echo $VERSION | cut -d ":" -f2) - STAR="" if $EXTRA_STAR && [ ! -f "/var/lib/jenkins/userContent/buildinfo/${PKG}_${EVERSION}_amd64.buildinfo" ] ; then - STAR="β" # used to be a star... + STAR[$PKG]="β" # used to be a star... fi # only build $PKG pages if they don't exist or are older than $BUILD_DATE NAVI="/var/lib/jenkins/userContent/rb-pkg/${PKG}_navigation.html" @@ -95,8 +95,6 @@ link_packages() { if [ -f "/var/lib/jenkins/userContent/buildinfo/${PKG}_${EVERSION}_amd64.buildinfo" ] ; then append2navi_frame " buildinfo " MAINLINK="$JENKINS_URL/userContent/buildinfo/${PKG}_${EVERSION}_amd64.buildinfo" - elif $EXTRA_STAR ; then - STAR="β" # used to be a star... fi if [ -f "/var/lib/jenkins/userContent/dbd/${PKG}_${EVERSION}.debbindiff.html" ] ; then append2navi_frame " debbindiff " @@ -119,7 +117,7 @@ link_packages() { write_pkg_frameset "$PKG" "$MAINLINK" fi if [ -f "/var/lib/jenkins/userContent/rbuild/${PKG}_${EVERSION}.rbuild.log" ] ; then - write_summary " $PKG$STAR " + write_summary " $PKG$STAR[$PKG] " else write_summary " $PKG " fi -- cgit v1.2.3-70-g09d2