From b81e11f0602e90f44989dc95f2cd09838df87e11 Mon Sep 17 00:00:00 2001
From: eliott <eliott@cactuswax.net>
Date: Wed, 16 Apr 2008 19:55:32 -0700
Subject: Added a test for what is effectively packages with super long
 descriptions.

Chop so we don't throw mysql errors when we try to commit.
---
 scripts/reporead.py | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'scripts')

diff --git a/scripts/reporead.py b/scripts/reporead.py
index 68c77ebe..958278b3 100755
--- a/scripts/reporead.py
+++ b/scripts/reporead.py
@@ -84,6 +84,10 @@ class Pkg(object):
                 if 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]
             elif x == 'force':
                 selfdict[x] = True
             elif x == 'version':
-- 
cgit v1.2.3-2-g168b