From 985685a82b52e62cede3292705db5e97f2a40bf4 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Wed, 15 Oct 2014 09:32:00 +0200 Subject: reproducible: add new helper script to blacklist packages + document it --- bin/reproducible_blacklist.sh | 57 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100755 bin/reproducible_blacklist.sh (limited to 'bin') diff --git a/bin/reproducible_blacklist.sh b/bin/reproducible_blacklist.sh new file mode 100755 index 00000000..dbb040e9 --- /dev/null +++ b/bin/reproducible_blacklist.sh @@ -0,0 +1,57 @@ +#!/bin/bash + +# Copyright 2014 Holger Levsen +# released under the GPLv=2 + +. /srv/jenkins/bin/common-functions.sh +common_init "$@" + +# common code defining db access +. /srv/jenkins/bin/reproducible_common.sh + +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');" + 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';") + if [ ! -z "$RESULT" ] ; then + PACKAGES="$PACKAGES $RESULT" + let "TOTAL+=1" + fi + done +} + + + +# +# main +# +set +x +CANDIDATES="$@" +check_candidates +PACKAGES=$(echo $PACKAGES) +MESSAGE="$TOTAL package(s) blacklisted: ${PACKAGES}" +if [ $TOTAL -lt 1 ] ; then + exit 1 +fi + +# finally +blacklist_packages +echo +echo "$MESSAGE" +kgb-client --conf /srv/jenkins/kgb/debian-reproducible.conf --relay-msg "$MESSAGE" +echo +echo "Probably edit notes.git/packages.yml now and enter reasons for blacklisting there" -- cgit v1.2.3-70-g09d2