summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhang Qiang <qiang.z.zhang@intel.com>2012-08-19 13:08:59 +0800
committerZhang Qiang <qiang.z.zhang@intel.com>2012-08-20 12:55:49 +0800
commit05e203e6a5b72739d5c7905d2b8fbf80aea65f16 (patch)
tree7d3a67478e5d70bbdd21f060bdd3910d400e30a3
parentcc429cd21cc605d7657ee607bcb96cceaed49a4a (diff)
downloadgit-buildpackage-release-for-gbsV0.9.tar.gz
git-buildpackage-release-for-gbsV0.9.tar.bz2
git-buildpackage-release-for-gbsV0.9.zip
Work arounded bug in rpm spec parsing. fixes #73release/for/gbsV0.9release-for-gbsV0.9
When spec has Patch: ... line it wrongly set patch number to -1, which has been converted to 32 bit unsigned int. even if in 64 bit system. make it more robust and readable, a constant is defined.
-rw-r--r--gbp/rpm/__init__.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/gbp/rpm/__init__.py b/gbp/rpm/__init__.py
index 744888b9..1aee9e51 100644
--- a/gbp/rpm/__init__.py
+++ b/gbp/rpm/__init__.py
@@ -34,6 +34,9 @@ from gbp.patch_series import (PatchSeries, Patch)
import gbp.log
from gbp.pkg import (PkgPolicy, UpstreamSource)
+# define a large number to check the valid id of source file
+MAX_SOURCE_NUMBER = 9999
+
# When trying to parse a version-number, these are
# the valid characters.
rpm_version_chars = 'a-zA-Z\d.~+'
@@ -223,7 +226,7 @@ class SpecFile(object):
# get patches
for (name, num, typ) in self.specinfo.sources:
# workaround rpm parsing bug
- if num == sys.maxint:
+ if num >= MAX_SOURCE_NUMBER:
num = 0
# only add files of patch type
if typ == 2: