summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2010-02-01 01:29:23 +0100
committerDan McGee <dan@archlinux.org>2010-02-01 01:29:23 +0100
commiteb2cadd20735c7f52817d5d82209c513a7563887 (patch)
tree4afc02cb100da8d3524fd65469d3c0c9b60e3342 /scripts
parent0cce15c7109cfb7bab976d35ca68961ddb9ad644 (diff)
downloadarchweb-eb2cadd20735c7f52817d5d82209c513a7563887.tar.gz
archweb-eb2cadd20735c7f52817d5d82209c513a7563887.tar.xz
Fix reporead choking on empty values
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/reporead.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/scripts/reporead.py b/scripts/reporead.py
index c0d43d1..2d1460c 100755
--- a/scripts/reporead.py
+++ b/scripts/reporead.py
@@ -93,13 +93,15 @@ class Pkg(object):
val['license'] = []
for x in val.keys():
if x in squash:
- if len(val[x]) == 0:
+ if val[x] == None or len(val[x]) == 0:
logger.warning("Package %s has no %s" % (selfdict['name'],x))
- selfdict[x] = ', '.join(val[x])
- # make sure we don't have elements larger than the db char
- # fields
- if len(selfdict[x]) > 255:
- selfdict[x] = selfdict[x][:254]
+ selfdict[x] = None
+ else:
+ selfdict[x] = ', '.join(val[x])
+ # make sure we don't have elements larger than the db char
+ # fields
+ if len(selfdict[x]) > 255:
+ selfdict[x] = selfdict[x][:254]
elif x == 'base':
selfdict[x] = val[x][0]
elif x == 'force':
@@ -395,3 +397,4 @@ if __name__ == '__main__':
logger.level = INFO
sys.exit(main())
+# vim: set ts=4 sw=4 et: