[Qa-jenkins-scm] [jenkins.debian.net] 01/01: reproducible: add option to remove a blacklisting
Holger Levsen
holger at moszumanska.debian.org
Fri May 22 09:56:01 UTC 2015
This is an automated email from the git hooks/post-receive script.
holger pushed a commit to branch master
in repository jenkins.debian.net.
commit 1e41f427dbfbd37692089aec0bdf5c3d3b1dd38f
Author: Holger Levsen <holger at layer-acht.org>
Date: Fri May 22 11:55:42 2015 +0200
reproducible: add option to remove a blacklisting
---
bin/reproducible_blacklist.sh | 38 ++++++++++++++++++++++++++++++++++----
1 file changed, 34 insertions(+), 4 deletions(-)
diff --git a/bin/reproducible_blacklist.sh b/bin/reproducible_blacklist.sh
index 9269c21..eaec7ea 100755
--- a/bin/reproducible_blacklist.sh
+++ b/bin/reproducible_blacklist.sh
@@ -21,6 +21,16 @@ blacklist_packages() {
done
}
+revert_blacklisted_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' AND suite='$SUITE';")
+ PKGID=$(sqlite3 -init $INIT ${PACKAGES_DB} "SELECT id FROM sources WHERE name='$PKG' AND suite='$SUITE';")
+ sqlite3 -init $INIT ${PACKAGES_DB} "DELETE FROM results WHERE package_id='$PKGID' AND status='blacklisted';"
+ done
+}
+
check_candidates() {
PACKAGES=""
TOTAL=0
@@ -46,16 +56,31 @@ if [ "$SUITE" = "sid" ] ; then
SUITE=unstable
fi
+if [ "$1" != "--revert" ] ; then
+ REVERT=false
+ ACTION="blacklisted"
+else
+ shift
+ REVERT=true
+ ACTION="removed from blacklist"
+fi
+
CANDIDATES="$@"
check_candidates
PACKAGES=$(echo $PACKAGES)
-MESSAGE="$TOTAL package(s) blacklisted in $SUITE: ${PACKAGES}"
+MESSAGE="$TOTAL package(s) $ACTION in $SUITE: ${PACKAGES}"
if [ $TOTAL -lt 1 ] ; then
exit 1
fi
-# finally
-blacklist_packages
+# main
+if [ "$1" != "--revert" ] ; then
+ blacklist_packages
+else
+ revert_blacklisted_packages
+fi
+
+# notify
gen_packages_html $SUITE $PACKAGES
echo
echo "$MESSAGE"
@@ -65,4 +90,9 @@ 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"
+echo "Probably edit notes.git/packages.yml now and enter/remove reasons for blacklisting there."
+
+# finally, let's re-schedule them if the blacklisted was reverted
+if [ "$1" = "--revert" ] ; then
+ /srv/jenkins/bin/reproducible_schedule_on_demand.sh $SUITE $PACKAGES
+fi
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git
More information about the Qa-jenkins-scm
mailing list