diff options
author | Dan McGee <dan@archlinux.org> | 2010-02-27 05:23:08 +0100 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2010-02-27 05:26:05 +0100 |
commit | e95c4563e328ea5e9943f72e72458e454fa7191a (patch) | |
tree | ff6ceaf855e553dc95c4269514f446c6755676a4 /devel/management | |
parent | 655b3db1b7a8a78cfd74723bd9ed17011ed0c935 (diff) | |
download | archweb-e95c4563e328ea5e9943f72e72458e454fa7191a.tar.gz archweb-e95c4563e328ea5e9943f72e72458e454fa7191a.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>
Diffstat (limited to 'devel/management')
-rwxr-xr-x | devel/management/commands/reporead.py | 5 |
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: |