From de0fdbd1e72a4d4a082483cc38444403006ef3bf Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Tue, 7 Oct 2014 13:52:52 +0200 Subject: reproducible: refactor, reduce db queries --- bin/reproducible_stats.sh | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'bin') diff --git a/bin/reproducible_stats.sh b/bin/reproducible_stats.sh index a079b811..35efbe86 100755 --- a/bin/reproducible_stats.sh +++ b/bin/reproducible_stats.sh @@ -64,11 +64,8 @@ init_navi_frame() { echo "" > $NAVI echo "" >> $NAVI echo "

$1 " >> $NAVI - RESULT=$(sqlite3 -init $INIT $PACKAGES_DB "SELECT build_date,version FROM source_packages WHERE name = \"$PKG\"") - BUILD_DATE=$(echo $RESULT|cut -d "|" -f1) - VERSION=$(echo $RESULT|cut -d "|" -f2) - echo "($VERSION) " >> $NAVI - echo "at $BUILD_DATE: " >> $NAVI + echo "($2) " >> $NAVI + echo "at $3: " >> $NAVI } append2navi_frame() { @@ -81,14 +78,16 @@ finish_navi_frame() { link_packages() { for PKG in $@ ; do - VERSION=$(sqlite3 -init $INIT $PACKAGES_DB "SELECT version FROM source_packages WHERE name = \"$PKG\"") + RESULT=$(sqlite3 -init $INIT $PACKAGES_DB "SELECT build_date,version FROM source_packages WHERE name = \"$PKG\"") + BUILD_DATE=$(echo $RESULT|cut -d "|" -f1) + VERSION=$(echo $RESULT|cut -d "|" -f2) # remove epoch EVERSION=$(echo $VERSION | cut -d ":" -f2) # FIXME: remove unused code once all diffp.log files are gone if [ -f "/var/lib/jenkins/userContent/dbd/${PKG}_${EVERSION}.debbindiff.html" ] || [ -f "/var/lib/jenkins/userContent/dbd/${PKG}_${EVERSION}.diffp.log" ] || [ -f "/var/lib/jenkins/userContent/buildinfo/${PKG}_${EVERSION}_amd64.buildinfo" ] || [ -f "/var/lib/jenkins/userContent/rbuild/${PKG}_${EVERSION}.rbuild.log" ]; then STAR="" MAINLINK="" - init_navi_frame "$PKG" + init_navi_frame "$PKG" "$VERSION" "$BUILD_DATE" 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