diff options
author | Sean Finney <seanius@seanius.net> | 2009-12-02 20:24:48 +0100 |
---|---|---|
committer | Sean Finney <seanius@seanius.net> | 2009-12-02 20:24:48 +0100 |
commit | e5fd3dd111d34276aa705f8eac09494cda178c98 (patch) | |
tree | b36476974d180210253237f8968803bc0f717780 /patchtracker/DB.py | |
parent | 11db52a1fedf54f728a9c7f6a890c1bc6d28bd7c (diff) | |
download | patch-tracker-e5fd3dd111d34276aa705f8eac09494cda178c98.tar.gz |
initial support for source package format 3.0 (quilt)
the changes aren't as pretty as i'd like them to be, but i don't want
to hold things up on mere aesthetic grounds and it seems to work anyway :)
Diffstat (limited to 'patchtracker/DB.py')
-rw-r--r-- | patchtracker/DB.py | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/patchtracker/DB.py b/patchtracker/DB.py index 88d2886..0bb0966 100644 --- a/patchtracker/DB.py +++ b/patchtracker/DB.py @@ -16,6 +16,10 @@ def srcpkg_factory(cursor, row): diffgz = {'name':d['diffgz_name'], 'size':d['diffgz_size'], 'md5sum':d['diffgz_md5sum'] } info['Files'].append(diffgz) + if d['debtar_name']: + debtar = {'name':d['debtar_name'], 'size':d['debtar_size'], + 'md5sum':d['debtar_md5sum'] } + info['Files'].append(debtar) colmap = {'name':'Package','version':'Version','format':'Format', 'loc':'Directory','maintainer':'Maintainer','uploaders':'Uploaders'} @@ -39,6 +43,10 @@ def srcpkg_collection_factory(cursor, row): diffgz = {'name':d['diffgz_name'], 'size':d['diffgz_size'], 'md5sum':d['diffgz_md5sum'] } info['Files'].append(diffgz) + if d['debtar_name']: + debtar = {'name':d['debtar_name'], 'size':d['debtar_size'], + 'md5sum':d['debtar_md5sum'] } + info['Files'].append(debtar) colmap = {'name':'Package','version':'Version','format':'Format', 'loc':'Directory','maintainer':'Maintainer','uploaders':'Uploaders'} @@ -70,11 +78,14 @@ class PatchTrackerDB: cursor = self.db.cursor() #print "creating new record for",srcpkg q = "INSERT OR IGNORE INTO packages \ - (name,format,loc,version,diffgz_name,diffgz_size,diffgz_md5sum,maintainer,uploaders) \ - VALUES (?,?,?,?,?,?,?,?,?)" + (name,format,loc,version,diffgz_name,diffgz_size,diffgz_md5sum,debtar_name,debtar_size,debtar_md5sum,maintainer,uploaders) \ + VALUES (?,?,?,?,?,?,?,?,?,?,?,?)" cursor.execute(q, (srcpkg.name,srcpkg.format,srcpkg.loc, srcpkg.version,srcpkg.diffgz_name,srcpkg.diffgz_size, - srcpkg.diffgz_md5sum,srcpkg.maintainers,srcpkg.uploaders)) + srcpkg.diffgz_md5sum, + srcpkg.debtar_name,srcpkg.debtar_size, + srcpkg.debtar_md5sum, + srcpkg.maintainers,srcpkg.uploaders)) def saveSuite(self, suite): q = "INSERT INTO suites (name) VALUES (?)" @@ -146,6 +157,16 @@ class PatchTrackerDB: except: return None + def findDebTar(self, pkgname, version): + q = "SELECT debtar_name,loc FROM packages WHERE name=? AND version=?" + cursor = self.db.cursor() + cursor.execute(q, (pkgname, version)) + try: + debtar,loc = cursor.fetchone() + return os.sep.join([Conf.archive_root, loc, debtar]) + except: + return None + def prune(self): q = "DELETE FROM package_rel_map WHERE marked != 1" cursor = self.db.cursor() |