diff options
author | Holger Levsen <holger@layer-acht.org> | 2015-05-22 11:55:42 +0200 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2015-05-22 11:55:42 +0200 |
commit | 1e41f427dbfbd37692089aec0bdf5c3d3b1dd38f (patch) | |
tree | 3ec070653fbfa7b3599907da1bc371cb61c3b63d /bin | |
parent | f57641267c499ac3597bb13731ca4eba760dbc3a (diff) | |
download | jenkins.debian.net-1e41f427dbfbd37692089aec0bdf5c3d3b1dd38f.tar.xz |
reproducible: add option to remove a blacklisting
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/reproducible_blacklist.sh | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/bin/reproducible_blacklist.sh b/bin/reproducible_blacklist.sh index 9269c21d..eaec7ea8 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 |