summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2015-01-02 15:05:51 +0100
committerHolger Levsen <holger@layer-acht.org>2015-01-02 15:05:51 +0100
commit53fc27dce85a1e0ba3989ffe332b102e1444f9e5 (patch)
tree826bdb9fb62f65e0541e7b493c5320e5b0377bad /bin
parentb6b14dcb622657d27fb871328ce768737b09d3ac (diff)
downloadjenkins.debian.net-53fc27dce85a1e0ba3989ffe332b102e1444f9e5.tar.xz
reproducible: only re-schedule old failures (atm)
Diffstat (limited to 'bin')
-rwxr-xr-xbin/reproducible_scheduler.sh40
1 files changed, 34 insertions, 6 deletions
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