Fix iterating spec sources with rpm >= 4.8.0.

http://rpm.org/wiki/Releases/4.8.0#Specclass


git-svn-id: svn+ssh://rpmlint.zarb.org/home/projects/rpmlint/svn/trunk@1720 9bc8b190-ac0f-0410-8968-dc7d1f502856
This commit is contained in:
Ville Skyttä 2010-01-25 23:05:02 +00:00
parent d0bddfc446
commit 6a9d13abcb
1 changed files with 7 additions and 1 deletions

View File

@ -526,7 +526,13 @@ class SpecCheck(AbstractCheck.AbstractCheck):
# errors logged above already
pass
if spec_obj:
for src in spec_obj.sources():
try:
# rpm < 4.8.0
sources = spec_obj.sources()
except TypeError:
# rpm >= 4.8.0
sources = spec_obj.sources
for src in sources:
(url, num, flags) = src
(scheme, netloc) = urlparse(url)[0:2]
if flags & 1: # rpmspec.h, rpm.org ticket #123