summaryrefslogtreecommitdiff
path: root/devel
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2012-12-12 17:42:33 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2012-12-12 17:42:33 -0500
commit8844fd0c6361d3a6ccd88647276e9af0e6cd64d2 (patch)
tree7615c29fe200a3c7be748d3d40ea35628ce9cd39 /devel
parentc0d6f0711c4760f08a6beb99818d075d7c993e2e (diff)
parentea87160c397fe1daf63851f0ed0be146bea79196 (diff)
Merge commit 'ea87160' (update)
Diffstat (limited to 'devel')
-rw-r--r--devel/management/commands/reporead.py12
-rw-r--r--devel/models.py6
-rw-r--r--devel/views.py4
3 files changed, 11 insertions, 11 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)
diff --git a/devel/models.py b/devel/models.py
index a9a2efc5..2fc61060 100644
--- a/devel/models.py
+++ b/devel/models.py
@@ -24,10 +24,8 @@ class MasterKey(models.Model):
class PGPSignature(models.Model):
- signer = PGPKeyField(max_length=40, verbose_name="Signer key fingerprint",
- help_text="consists of 40 hex digits; use `gpg --fingerprint`")
- signee = PGPKeyField(max_length=40, verbose_name="Signee key fingerprint",
- help_text="consists of 40 hex digits; use `gpg --fingerprint`")
+ signer = PGPKeyField(max_length=40, verbose_name="Signer key fingerprint")
+ signee = PGPKeyField(max_length=40, verbose_name="Signee key fingerprint")
created = models.DateField()
expires = models.DateField(null=True, blank=True)
valid = models.BooleanField(default=True)
diff --git a/devel/views.py b/devel/views.py
index 33314931..36d0cccf 100644
--- a/devel/views.py
+++ b/devel/views.py
@@ -101,8 +101,8 @@ def clock(request):
response = direct_to_template(request, 'devel/clock.html', page_dict)
if not response.has_header('Expires'):
# why this works only with the non-UTC date I have no idea...
- expire_time = now.replace(minute=utc_now.minute + 1,
- second=0, microsecond=0)
+ expire_time = now.replace(second=0, microsecond=0)
+ expire_time += timedelta(minutes=1)
expire_time = time.mktime(expire_time.timetuple())
response['Expires'] = http_date(expire_time)
return response