From 53fc27dce85a1e0ba3989ffe332b102e1444f9e5 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Fri, 2 Jan 2015 15:05:51 +0100 Subject: reproducible: only re-schedule old failures (atm) --- bin/reproducible_scheduler.sh | 40 ++++++++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 6 deletions(-) (limited to 'bin') diff --git a/bin/reproducible_scheduler.sh b/bin/reproducible_scheduler.sh index fbbdc06e..c780cbec 100755 --- a/bin/reproducible_scheduler.sh +++ b/bin/reproducible_scheduler.sh @@ -132,6 +132,25 @@ select_old_versions() { do_sql_query "tested at least two weeks ago, no new version available, sorted by last test date" } +select_old_failures() { + # old failures older than two weeks only + QUERY=" + SELECT DISTINCT sources.name FROM sources,source_packages + WHERE sources.name NOT IN + (SELECT sources.name FROM sources,sources_scheduled + WHERE sources.name=sources_scheduled.name) + AND sources.name IN + (SELECT sources.name FROM sources,source_packages + WHERE sources.name=source_packages.name + AND sources.version=source_packages.version + AND source_packages.status!='blacklisted' + AND source_packages.status!='reproducible') + AND sources.name=source_packages.name + AND source_packages.build_date < datetime('now', '-2 day') + ORDER BY source_packages.build_date + LIMIT $1" + do_sql_query "tested at least two days ago, not reproducible, no new version available, sorted by last test date" +} schedule_packages() { DATE=$(date +'%Y-%m-%d %H:%M') @@ -153,7 +172,7 @@ deselect_old_with_buildinfo() { if [ ! -f /var/lib/jenkins/userContent/buildinfo/${PKG}_.buildinfo ] ; then PACKAGES="$PACKAGES $PKG" else - let "AMOUNT=$AMOUNT-1" + let "AMOUNT=$AMOUNT-1" || AMOUNT=0 fi done } @@ -214,15 +233,24 @@ elif [ $TOTAL -le 350 ] ; then else OLD=1 fi -echo "Requesting $OLD old packages..." -select_old_versions $OLD -echo -n "Found $AMOUNT old packages, " +# pointless atm +#echo "Requesting $OLD old packages..." +#select_old_versions $OLD +#echo -n "Found $AMOUNT old packages, " +#deselect_old_with_buildinfo $PACKAGES +#echo "kept $AMOUNT old packages without .buildinfo files." +#let "TOTAL=$TOTAL+$AMOUNT" +#ALL_PACKAGES="$ALL_PACKAGES $PACKAGES" + +echo "Requesting $OLD old+failed packages..." +select_old_failures $OLD +echo -n "Found $AMOUNT old+failed packages, " deselect_old_with_buildinfo $PACKAGES echo "kept $AMOUNT old packages without .buildinfo files." - let "TOTAL=$TOTAL+$AMOUNT" -echo "So in total now $TOTAL packages about to be scheduled." ALL_PACKAGES="$ALL_PACKAGES $PACKAGES" + +echo "So in total now $TOTAL packages about to be scheduled." MESSAGE="$MESSAGE and $AMOUNT packages with the same version (but without .buildinfo files) again, for a total of $TOTAL scheduled packages." # finally -- cgit v1.2.3-70-g09d2