diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2007-10-24 08:49:31 +0000 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2007-10-24 08:49:31 +0000 |
commit | 0ee0c0c607c5921fe6baab3da0b5a0b4c7a3ef4e (patch) | |
tree | eab71af7712d20d5bf70eacf803250b81d5c48e0 /dbgenerator | |
parent | Store the SHA1 and mtime for each ebuild and the package ChangeLog. ebuild mt... (diff) | |
download | packages-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.py | 17 |
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) |