Workarounded bug in rpm spec parsing. fixes #73
authorEd Bartosh <eduard.bartosh@intel.com>
Wed, 13 Jun 2012 07:45:26 +0000 (10:45 +0300)
committerEd Bartosh <eduard.bartosh@intel.com>
Wed, 13 Jun 2012 08:03:18 +0000 (11:03 +0300)
When spec has Patch: ... line it wrongly set patch number to MAXINT
instead of 0.

Change-Id: Ieb462f8068b98724a2035394b80514982168d3c8

gbp/rpm/__init__.py

index 625ed66248baa998683ccdc30b02abc75a04561a..2af6ee832f570b6a4f3d6bcc793276698b030cf0 100644 (file)
@@ -18,6 +18,7 @@
 """provides some rpm source package related helpers"""
 
 import commands
+import sys
 import os
 import re
 import tempfile
@@ -221,6 +222,9 @@ class SpecFile(object):
 
         # get patches
         for (name, num, typ) in self.specinfo.sources:
+            # workaround rpm parsing bug
+            num == sys.maxint:
+                num = 0
             # only add files of patch type
             if typ == 2:
                 self.patches[num] = {'filename': name, 'strip': '0', 'apply': False, 'autoupdate': False}