From 0ce9d35abc871830d6d58176a9bc12f52d1ac359 Mon Sep 17 00:00:00 2001 From: Mattia Rizzolo Date: Wed, 18 Feb 2015 01:04:59 +0100 Subject: reproducible: blacklist: update to a new database schema supporting multiple suites + move the informative echo at the end --- bin/reproducible_blacklist.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'bin/reproducible_blacklist.sh') diff --git a/bin/reproducible_blacklist.sh b/bin/reproducible_blacklist.sh index a6f02155..1727ad85 100755 --- a/bin/reproducible_blacklist.sh +++ b/bin/reproducible_blacklist.sh @@ -14,20 +14,17 @@ blacklist_packages() { DATE=$(date +'%Y-%m-%d %H:%M') TMPFILE=$(mktemp) for PKG in $PACKAGES ; do - VERSION=$(sqlite3 -init $INIT ${PACKAGES_DB} "SELECT version from sources WHERE name = '$PKG';") - sqlite3 -init $INIT ${PACKAGES_DB} "REPLACE INTO source_packages VALUES ('$PKG','$VERSION','blacklisted','$DATE');" + VERSION=$(sqlite3 -init $INIT ${PACKAGES_DB} "SELECT version FROM sources WHERE name='$PKG' AND suite='$SUITE';") + PKGID=$(sqlite3 -init $INIT ${PACKAGES_DB} "SELECT id FROM sources WHERE name='$PKG' AND suite='$SUITE';") + sqlite3 -init $INIT ${PACKAGES_DB} "REPLACE INTO results (package_id, version, status, build_date) VALUES ('$PKGID', '$VERSION', 'blacklisted', '$DATE');" done - echo "=============================================================================" - echo "The following $TOTAL source packages have been (re-)scheduled: $PACKAGES" - echo "=============================================================================" - echo } check_candidates() { PACKAGES="" TOTAL=0 for PKG in $CANDIDATES ; do - RESULT=$(sqlite3 -init $INIT ${PACKAGES_DB} "SELECT name from sources WHERE name = '$PKG';") + RESULT=$(sqlite3 -init $INIT ${PACKAGES_DB} "SELECT name from sources WHERE name='$PKG' AND suite='$SUITE';") if [ ! -z "$RESULT" ] ; then PACKAGES="$PACKAGES $RESULT" let "TOTAL+=1" @@ -41,6 +38,8 @@ check_candidates() { # main # set +x +SUITE="$1" +shift CANDIDATES="$@" check_candidates PACKAGES=$(echo $PACKAGES) @@ -56,4 +55,8 @@ echo echo "$MESSAGE" kgb-client --conf /srv/jenkins/kgb/debian-reproducible.conf --relay-msg "$MESSAGE" echo +echo "=============================================================================" +echo "The following $TOTAL source packages from $SUITE have been blacklisted: $PACKAGES" +echo "=============================================================================" +echo echo "Probably edit notes.git/packages.yml now and enter reasons for blacklisting there" -- cgit v1.2.3-54-g00ecf