summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2015-02-26 19:58:37 +0100
committerMattia Rizzolo <mattia@mapreri.org>2015-02-26 19:58:37 +0100
commitb1eeaac358b232a53b8a0e5f4f3a3ebcd56f4c66 (patch)
treecd959993fdf7d01ad8ad7f42bb80fc736a65feba
parent8b0a8c500b4200b1a114cbbd106a6e4d111c415b (diff)
downloadjenkins.debian.net-b1eeaac358b232a53b8a0e5f4f3a3ebcd56f4c66.tar.xz
reproducible: maintainance: update to the new db schema. disable the check for RM'ed packages. yet, hardcode sid in the auto-rescheduler
-rw-r--r--TODO1
-rwxr-xr-xbin/reproducible_maintainance.sh24
2 files changed, 15 insertions, 10 deletions
diff --git a/TODO b/TODO
index 063f870e..5b7f0788 100644
--- a/TODO
+++ b/TODO
@@ -157,6 +157,7 @@ properties:
** include no js header in the css
** use one css for all, not two minimally different ones
** graph oldest build age - in days
+** restore the "find packages which have been removed from sid" part of reproducible_maintainance.sh
=== qa.debian.org*
diff --git a/bin/reproducible_maintainance.sh b/bin/reproducible_maintainance.sh
index 7e08b5fd..8def64d0 100755
--- a/bin/reproducible_maintainance.sh
+++ b/bin/reproducible_maintainance.sh
@@ -93,7 +93,8 @@ if [ ! -z "$FAILED_BUILDS" ] ; then
echo "$FAILED_BUILDS"
echo
echo "Rescheduling packages: "
- ( for PKG in $(echo $FAILED_BUILDS | sed "s# #\n#g" | cut -d "/" -f7 | cut -d "_" -f1) ; do echo $PKG ; done ) | xargs /srv/jenkins/bin/reproducible_schedule_on_demand.sh
+ # FIXME the suite got hardcoded here, a way to recognize the original suite must be found
+ ( for PKG in $(echo $FAILED_BUILDS | sed "s# #\n#g" | cut -d "/" -f7 | cut -d "_" -f1) ; do echo $PKG ; done ) | xargs /srv/jenkins/bin/reproducible_schedule_on_demand.sh sid
echo
DIRTY=true
fi
@@ -124,24 +125,25 @@ rm $HAYSTACK $RESULT
# find packages which build didnt end correctly
QUERY="
- SELECT * FROM sources_scheduled
- WHERE date_scheduled != ''
- AND date_build_started != ''
- AND date_build_started < datetime('now', '-36 hours')
- ORDER BY date_scheduled
+ SELECT s.id, s.name, p.date_scheduled, p.date_build_started
+ FROM schedule AS p JOIN sources AS s ON p.package_id=s.id
+ WHERE p.date_scheduled != ''
+ AND p.date_build_started != ''
+ AND p.date_build_started < datetime('now', '-36 hours')
+ ORDER BY p.date_scheduled
"
PACKAGES=$(mktemp)
sqlite3 -init $INIT ${PACKAGES_DB} "$QUERY" > $PACKAGES 2> /dev/null || echo "Warning: SQL query '$QUERY' failed."
if grep -q '|' $PACKAGES ; then
echo
echo "Warning: packages found where the build was started more than 36h ago:"
- echo "name|date_scheduled|date_build_started"
+ echo "pkg_id|name|date_scheduled|date_build_started"
echo
cat $PACKAGES
echo
for PKG in $(cat $PACKAGES | cut -d "|" -f1) ; do
- echo "sqlite3 ${PACKAGES_DB} \"DELETE FROM sources_scheduled WHERE name = '$PKG';\""
- sqlite3 -init $INIT ${PACKAGES_DB} \"DELETE FROM sources_scheduled WHERE name = '$PKG';\"
+ echo "sqlite3 ${PACKAGES_DB} \"DELETE FROM schedule WHERE package_id = '$PKG';\""
+ sqlite3 -init $INIT ${PACKAGES_DB} \"DELETE FROM schedule WHERE package_id = '$PKG';\"
done
echo "Packages have been removed from scheduling."
echo
@@ -150,11 +152,13 @@ fi
rm $PACKAGES
# find packages which have been removed from sid
+# commented out for now. This can't be done using the database anymore
QUERY="SELECT source_packages.name FROM source_packages
WHERE source_packages.name NOT IN
(SELECT sources.name FROM sources)
LIMIT 25"
-PACKAGES=$(sqlite3 -init $INIT ${PACKAGES_DB} "$QUERY")
+#PACKAGES=$(sqlite3 -init $INIT ${PACKAGES_DB} "$QUERY")
+PACKAGES=''
if [ ! -z "$PACKAGES" ] ; then
echo
echo "Removing these removed packages from database:"