summaryrefslogtreecommitdiffstats
path: root/git-interface/git-update.py
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@archlinux.org>2016-08-05 11:36:19 +0200
committerLukas Fleischer <lfleischer@archlinux.org>2016-08-05 12:05:22 +0200
commitf2a6bd207d5c3400e304c53f0b6eafb4bc5b7ece (patch)
tree0a7fe5b21abbbdf077bab41005ff35df25f3ee52 /git-interface/git-update.py
parent27631f1157226bd9ca4d0dbfb6a59c7656e7e361 (diff)
downloadaurweb-f2a6bd207d5c3400e304c53f0b6eafb4bc5b7ece.tar.xz
git-interface: Do not use UNIX_TIMESTAMP
Avoid using UNIX_TIMESTAMP which is not part of the SQL standard. Retrieve the current UNIX time in Python and substitute it into the SQL queries instead. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'git-interface/git-update.py')
-rwxr-xr-xgit-interface/git-update.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/git-interface/git-update.py b/git-interface/git-update.py
index d6c9f10..2820720 100755
--- a/git-interface/git-update.py
+++ b/git-interface/git-update.py
@@ -5,6 +5,7 @@ import pygit2
import re
import subprocess
import sys
+import time
import srcinfo.parse
import srcinfo.utils
@@ -70,9 +71,10 @@ def save_metadata(metadata, conn, user):
user_id = int(cur.fetchone()[0])
# Update package base details and delete current packages.
- conn.execute("UPDATE PackageBases SET ModifiedTS = UNIX_TIMESTAMP(), " +
+ now = int(time.time())
+ conn.execute("UPDATE PackageBases SET ModifiedTS = ?, " +
"PackagerUID = ?, OutOfDateTS = NULL WHERE ID = ?",
- [user_id, pkgbase_id])
+ [now, user_id, pkgbase_id])
conn.execute("UPDATE PackageBases SET MaintainerUID = ? " +
"WHERE ID = ? AND MaintainerUID IS NULL",
[user_id, pkgbase_id])