diff options
author | Holger Levsen <holger@layer-acht.org> | 2014-10-07 13:52:52 +0200 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2014-10-07 13:52:52 +0200 |
commit | de0fdbd1e72a4d4a082483cc38444403006ef3bf (patch) | |
tree | ba945994cce5befe4f98b2f3000255782b5fc700 /bin | |
parent | 0bebc950b75cc4eaec9ccdbb0b2b04ce4b813562 (diff) | |
download | jenkins.debian.net-de0fdbd1e72a4d4a082483cc38444403006ef3bf.tar.xz |
reproducible: refactor, reduce db queries
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/reproducible_stats.sh | 13 |
1 files changed, 6 insertions, 7 deletions
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 "<!DOCTYPE html><html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />" > $NAVI echo "<link href=\"../static/style.css\" type=\"text/css\" rel=\"stylesheet\" /></head>" >> $NAVI echo "<body><p><font size=+1>$1</font> " >> $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 "<font size=-1>at $BUILD_DATE:</font> " >> $NAVI + echo "($2) " >> $NAVI + echo "<font size=-1>at $3:</font> " >> $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 " <a href=\"$JENKINS_URL/userContent/buildinfo/${PKG}_${EVERSION}_amd64.buildinfo\" target=\"main\">buildinfo</a> " MAINLINK="$JENKINS_URL/userContent/buildinfo/${PKG}_${EVERSION}_amd64.buildinfo" |