summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_maintenance.sh
diff options
context:
space:
mode:
authorValerie R Young <spectranaut@riseup.net>2016-09-16 21:09:49 -0400
committerHolger Levsen <holger@layer-acht.org>2016-11-08 16:53:29 +0100
commit21ce98cd746a35df07891084baea6bbde1876166 (patch)
tree8e27f66673e78ba9d573d417f4953e66af7b9d19 /bin/reproducible_maintenance.sh
parent464d96e0aea8158077777ddd42cd2cc3d6bbd01a (diff)
downloadjenkins.debian.net-21ce98cd746a35df07891084baea6bbde1876166.tar.xz
reproducible debian: make bash sql sqlite/postgres agnostic
This commit does the following for all bash scripts: - remove sqlite specfic datetime functions in sql queries - remove double quotes from sql queries - replace the "REPLACE INTO" sql queries Signed-off-by: Mattia Rizzolo <mattia@debian.org> Signed-off-by: Holger Levsen <holger@layer-acht.org>
Diffstat (limited to 'bin/reproducible_maintenance.sh')
-rwxr-xr-xbin/reproducible_maintenance.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/bin/reproducible_maintenance.sh b/bin/reproducible_maintenance.sh
index 5450395a..6ff3d106 100755
--- a/bin/reproducible_maintenance.sh
+++ b/bin/reproducible_maintenance.sh
@@ -249,12 +249,13 @@ if [ "$HOSTNAME" = "$MAINNODE" ] ; then
# find packages which build didnt end correctly
#
echo "$(date -u) - Rescheduling builds which didn't end correctly."
+ DATE=$(date '+%Y-%m-%d %H:%M' -d "-2 days")
QUERY="
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 IS NOT NULL
- AND p.date_build_started < datetime('now', '-48 hours')
+ AND p.date_build_started < '$DATE'
ORDER BY p.date_scheduled
"
PACKAGES=$(mktemp --tmpdir=$TEMPDIR maintenance-XXXXXXXXXXXX)