summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-03-16 15:12:44 +0100
committerDan McGee <dan@archlinux.org>2012-03-16 15:13:16 +0100
commitc81aa8955dd5992f7039e1640243325c82d011cc (patch)
treec73dff35ca69964f72911d9c70f61cd8872414b3
parent6ee65265a051933ee154c42490fdc509b9994202 (diff)
downloadarchweb-c81aa8955dd5992f7039e1640243325c82d011cc.tar.gz
archweb-c81aa8955dd5992f7039e1640243325c82d011cc.tar.xz
reporead: rename Pkg to RepoPackage
The bytes saved on the shorter name aren't worth it. Also ensure 'desc' is always initialized to None in case packages do not provide one. Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--devel/management/commands/reporead.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/devel/management/commands/reporead.py b/devel/management/commands/reporead.py
index 3ed95a9..8369b6e 100644
--- a/devel/management/commands/reporead.py
+++ b/devel/management/commands/reporead.py
@@ -70,7 +70,7 @@ class Command(BaseCommand):
return read_repo(arch, filename, options)
-class Pkg(object):
+class RepoPackage(object):
"""An interim 'container' object for holding Arch package data."""
bare = ( 'name', 'base', 'arch', 'filename',
'md5sum', 'sha256sum', 'url', 'packager' )
@@ -85,6 +85,7 @@ class Pkg(object):
self.ver = None
self.rel = None
self.epoch = 0
+ self.desc = None
self.pgpsig = None
for k in self.bare + self.number:
setattr(self, k, None)
@@ -458,7 +459,7 @@ def parse_info(iofile):
def parse_repo(repopath):
"""
- Parses an Arch repo db file, and returns a list of Pkg objects.
+ Parses an Arch repo db file, and returns a list of RepoPackage objects.
Arguments:
repopath -- The path of a repository db file.
@@ -480,7 +481,7 @@ def parse_repo(repopath):
repodb = tarfile.open(repopath, "r")
logger.debug("Starting package parsing")
dbfiles = ('desc', 'depends', 'files')
- newpkg = lambda: Pkg(reponame)
+ newpkg = lambda: RepoPackage(reponame)
pkgs = defaultdict(newpkg)
for tarinfo in repodb.getmembers():
if tarinfo.isreg():