summaryrefslogtreecommitdiffstats
path: root/git-interface/git-serve.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-serve.py
parent27631f1157226bd9ca4d0dbfb6a59c7656e7e361 (diff)
downloadaur-f2a6bd207d5c3400e304c53f0b6eafb4bc5b7ece.tar.gz
aur-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-serve.py')
-rwxr-xr-xgit-interface/git-serve.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/git-interface/git-serve.py b/git-interface/git-serve.py
index 6377ffce..d3a32c39 100755
--- a/git-interface/git-serve.py
+++ b/git-interface/git-serve.py
@@ -4,6 +4,7 @@ import os
import re
import shlex
import sys
+import time
import config
import db
@@ -58,10 +59,10 @@ def create_pkgbase(pkgbase, user):
if userid == 0:
die('{:s}: unknown user: {:s}'.format(action, user))
+ now = int(time.time())
cur = conn.execute("INSERT INTO PackageBases (Name, SubmittedTS, " +
"ModifiedTS, SubmitterUID, MaintainerUID) VALUES " +
- "(?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), ?, ?)",
- [pkgbase, userid, userid])
+ "(?, ?, ?, ?, ?)", [pkgbase, now, now, userid, userid])
pkgbase_id = cur.lastrowid
cur = conn.execute("INSERT INTO PackageNotifications " +