aboutsummaryrefslogtreecommitdiffstats
path: root/create-srpm
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2012-02-10 21:14:23 +0000
committerNicolas Vigier <boklm@mageia.org>2012-02-10 21:14:23 +0000
commit39f1a32d93adef18e47ac9cb432d655bda60bb96 (patch)
tree8b698d41093e53b3a42472aa5469411e66b8157d /create-srpm
parent5fbe91c7097ac79dd77df398a498f4824af9fae4 (diff)
downloadmgarepo-39f1a32d93adef18e47ac9cb432d655bda60bb96.tar
mgarepo-39f1a32d93adef18e47ac9cb432d655bda60bb96.tar.gz
mgarepo-39f1a32d93adef18e47ac9cb432d655bda60bb96.tar.bz2
mgarepo-39f1a32d93adef18e47ac9cb432d655bda60bb96.tar.xz
mgarepo-39f1a32d93adef18e47ac9cb432d655bda60bb96.zip
add sql file to create youridb
Diffstat (limited to 'create-srpm')
-rwxr-xr-xcreate-srpm8
1 files changed, 4 insertions, 4 deletions
diff --git a/create-srpm b/create-srpm
index b49972d..837c776 100755
--- a/create-srpm
+++ b/create-srpm
@@ -30,7 +30,7 @@ class youridb:
dbpasswd = config.get("youridb", "dbpasswd")
dbhost = config.get("youridb", "dbhost")
sslmode = 1
- self.db = psycopg2.connect(dbname=dbname, user=dbuser,
+ self.db = psycopg2.connect(database=dbname, user=dbuser,
password=dbpasswd, host=dbhost)
def add(self, srpm, url, revision, packager):
@@ -39,8 +39,8 @@ class youridb:
rpmEVR = rpmhdr[rpm.RPMTAG_EVR]
rpmsha1 = file_hash(srpm)
cur = self.db.cursor()
- cur.execute("INSERT INTO submits (sha1, rpmname, EVR, packager, url, revision, status) VALUES (%s, %s, %s, %s, %s, %s, %s);",
- (rpmsha1, rpmname, rpmEVR, packager, url, revision, 'create-srpm'))
+ cur.execute("INSERT INTO submits (sha1, rpmname, EVR, packager, url, revision, status, submit_ts) VALUES (%s, %s, %s, %s, %s, %s, %s, CURRENT_TIMESTAMP);",
+ (rpmsha1, rpmname, rpmEVR, packager, url, revision, '1'))
cur.close()
self.db.commit()
@@ -58,7 +58,7 @@ class CmdIface:
try:
db = youridb()
except Exception, e:
- print e.pgerror
+ print 'youridb error:', e
return 0
pw = pwd.getpwuid(os.getuid())
username = pw[0]