aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2007-10-24 08:49:31 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2007-10-24 08:49:31 +0000
commit0ee0c0c607c5921fe6baab3da0b5a0b4c7a3ef4e (patch)
treeeab71af7712d20d5bf70eacf803250b81d5c48e0 /dbgenerator
parentStore the SHA1 and mtime for each ebuild and the package ChangeLog. ebuild mt... (diff)
downloadpackages-3-0ee0c0c607c5921fe6baab3da0b5a0b4c7a3ef4e.tar.gz
packages-3-0ee0c0c607c5921fe6baab3da0b5a0b4c7a3ef4e.tar.bz2
packages-3-0ee0c0c607c5921fe6baab3da0b5a0b4c7a3ef4e.zip
Accessor function for the changelog metadata.
Diffstat (limited to 'dbgenerator')
-rw-r--r--dbgenerator/database.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/dbgenerator/database.py b/dbgenerator/database.py
index d882366..f77e43f 100644
--- a/dbgenerator/database.py
+++ b/dbgenerator/database.py
@@ -212,6 +212,23 @@ class SQLPackageDatabase(object):
self.cursor.execute(sql, params)
self.db.commit()
+ sql['SELECT_get_changelog'] = """
+ SELECT changelog, changelog_mtime, changelog_sha1
+ FROM metadata
+ WHERE cp = ?
+ """
+ def get_changelog(self, cat, pn):
+ cp = self.find_cp(cat, pn)
+ result = (None, -1, None)
+ if cp is None:
+ return result
+ sql = self.sql['SELECT_get_changelog']
+ self.cursor.execute(sql, (cp, ))
+ row = self.cursor.fetchone()
+ if row:
+ result = (unicode(row[0]), int(row[1]), str(row[2]))
+ return result
+
sql['INSERT_versions'] = """
INSERT INTO versions
(cp, pv, mtime, sha1)