diff options
author | Mattia Rizzolo <mattia@mapreri.org> | 2015-02-18 01:04:59 +0100 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2015-02-26 17:13:54 +0100 |
commit | 0ce9d35abc871830d6d58176a9bc12f52d1ac359 (patch) | |
tree | 68448ce2ab4ed89b0387a5595d3f3e55b04a3c6a /bin | |
parent | 9639fdd4594cfd8e0d65058ecd8e41775f0114c7 (diff) | |
download | jenkins.debian.net-0ce9d35abc871830d6d58176a9bc12f52d1ac359.tar.xz |
reproducible: blacklist: update to a new database schema supporting multiple suites + move the informative echo at the end
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/reproducible_blacklist.sh | 17 |
1 files changed, 10 insertions, 7 deletions
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" |