From 8aab55cc86193b2d8c45707ce86d7cc147b94cc6 Mon Sep 17 00:00:00 2001 From: Mattia Rizzolo Date: Tue, 7 Apr 2015 19:35:54 +0200 Subject: reproducible: build: refactor: save the correct version to the DB --- bin/reproducible_build.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/reproducible_build.sh b/bin/reproducible_build.sh index 29953733..b4628019 100755 --- a/bin/reproducible_build.sh +++ b/bin/reproducible_build.sh @@ -78,7 +78,10 @@ calculate_build_duration() { update_db_and_html() { # everything passed at this function is saved as a status of this package in the db local STATUS="$@" - sqlite3 -init $INIT ${PACKAGES_DB} "REPLACE INTO results (package_id, version, status, build_date, build_duration) VALUES ('${SRCPKGID}', 'None', '$STATUS', '$DATE', '$DURATION')" + if [ -z "$VERSION" ] ; then + VERSION="None" + fi + sqlite3 -init $INIT ${PACKAGES_DB} "REPLACE INTO results (package_id, version, status, build_date, build_duration) VALUES ('${SRCPKGID}', '$VERSION', '$STATUS', '$DATE', '$DURATION')" if [ ! -z "$DURATION" ] ; then # this happens when not 404 and not_for_us sqlite3 -init $INIT ${PACKAGES_DB} "INSERT INTO stats_build (name, version, suite, architecture, status, build_date, build_duration) VALUES ('${SRCPACKAGE}', '${VERSION}', '${SUITE}', '${ARCH}', '${STATUS}', '${DATE}', '${DURATION}')" fi -- cgit v1.2.3-70-g09d2