summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2010-02-27 05:23:08 +0100
committerDan McGee <dan@archlinux.org>2010-02-27 05:26:05 +0100
commite95c4563e328ea5e9943f72e72458e454fa7191a (patch)
treeff6ceaf855e553dc95c4269514f446c6755676a4
parent655b3db1b7a8a78cfd74723bd9ed17011ed0c935 (diff)
downloadarchweb-e95c4563e32.tar.gz
archweb-e95c4563e32.tar.xz
reporead: accommodate old-school build date
I can't believe we still have some of these around, but they are relatively straightforward to handle. Signed-off-by: Dan McGee <dan@archlinux.org>
-rwxr-xr-xdevel/management/commands/reporead.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/devel/management/commands/reporead.py b/devel/management/commands/reporead.py
index dad5d30..bf3e7a0 100755
--- a/devel/management/commands/reporead.py
+++ b/devel/management/commands/reporead.py
@@ -141,7 +141,10 @@ def populate_pkg(dbpkg, repopkg, timestamp=None):
dbpkg.url = repopkg.url
dbpkg.compressed_size = int(repopkg.csize)
dbpkg.installed_size = int(repopkg.isize)
- dbpkg.build_date = datetime.utcfromtimestamp(int(repopkg.builddate))
+ try:
+ dbpkg.build_date = datetime.utcfromtimestamp(int(repopkg.builddate))
+ except:
+ dbpkg.build_date = datetime.strptime(repopkg.builddate, '%a %b %d %H:%M:%S %Y')
dbpkg.needupdate = False
if timestamp: