Don't try to check Content-Length and Content-MD5 for invalid source URLs.
git-svn-id: svn+ssh://rpmlint.zarb.org/home/projects/rpmlint/svn/trunk@1836 9bc8b190-ac0f-0410-8968-dc7d1f502856
This commit is contained in:
parent
c1693659f4
commit
40267d21ce
|
@ -542,14 +542,15 @@ class SpecCheck(AbstractCheck.AbstractCheck):
|
|||
tag = '%s%s' % (srctype, num)
|
||||
if scheme and netloc:
|
||||
info = self.check_url(pkg, tag, url)
|
||||
if not info or not hasattr(pkg, 'files'):
|
||||
continue
|
||||
clen = info.get("Content-Length")
|
||||
if clen is not None:
|
||||
clen = int(clen)
|
||||
cmd5 = info.get("Content-MD5")
|
||||
if cmd5 is not None:
|
||||
cmd5 = cmd5.lower()
|
||||
if (clen is not None or cmd5 is not None) \
|
||||
and hasattr(pkg, 'files'):
|
||||
if clen is not None or cmd5 is not None:
|
||||
# Not using path from urlparse results to match how
|
||||
# rpm itself parses the basename.
|
||||
pkgfile = pkg.files()[url.split("/")[-1]]
|
||||
|
|
Loading…
Reference in New Issue