summaryrefslogtreecommitdiff
path: root/devel/management/commands/reporead.py
diff options
context:
space:
mode:
Diffstat (limited to 'devel/management/commands/reporead.py')
-rw-r--r--devel/management/commands/reporead.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/devel/management/commands/reporead.py b/devel/management/commands/reporead.py
index 30c09c5e..d0e5ef3d 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)
@@ -463,7 +464,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.
@@ -485,7 +486,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():
@@ -541,8 +542,9 @@ def read_repo(primary_arch, repo_file, options):
if package.arch in packages_arches:
packages_arches[package.arch].append(package)
else:
- # we don't include mis-arched packages
- logger.warning("Package %s arch = %s", package.name, package.arch)
+ raise Exception(
+ "Package %s in database %s had wrong architecture %s" % (
+ package.name, repo_file, package.arch))
del packages
logger.info('Starting database updates for %s.', repo_file)