fix source url 404 bug

This commit is contained in:
Tom "spot" Callaway 2011-03-03 12:07:13 -05:00
parent 8980a9829c
commit 6541858153
2 changed files with 31 additions and 1 deletions

View File

@ -0,0 +1,21 @@
diff -up rpmlint-1.1/SpecCheck.py.404fix rpmlint-1.1/SpecCheck.py
--- rpmlint-1.1/SpecCheck.py.404fix 2011-03-03 11:54:47.001854005 -0500
+++ rpmlint-1.1/SpecCheck.py 2011-03-03 11:57:11.012854018 -0500
@@ -542,14 +542,15 @@ class SpecCheck(AbstractCheck.AbstractCh
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]]

View File

@ -1,6 +1,6 @@
Name: rpmlint
Version: 1.1
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Tool for checking common errors in RPM packages
Group: Development/Tools
@ -16,6 +16,11 @@ Source4: %{name}.config.el4
Source5: %{name}.config.el5
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
# Don't try to check Content-Length and Content-MD5 for invalid Source URLs
# http://rpmlint.zarb.org/cgi-bin/trac.cgi/changeset/1836
# https://bugzilla.redhat.com/show_bug.cgi?id=680781
Patch0: rpmlint-1.1-changeset1836.patch
BuildArch: noarch
BuildRequires: python >= 2.4
BuildRequires: rpm-python >= 4.4
@ -43,6 +48,7 @@ and source packages as well as spec files can be checked.
%prep
%setup -q
%patch0 -p1 -b .1836
sed -i -e /MenuCheck/d Config.py
cp -p config config.example
install -pm 644 %{SOURCE2} CHANGES.package.old
@ -89,6 +95,9 @@ rm -rf $RPM_BUILD_ROOT
%changelog
* Thu Mar 3 2011 Tom Callaway <spot@fedoraproject.org> - 1.1-2
- apply upstream fix for source url aborts (bz 680781)
* Fri Feb 4 2011 Tom Callaway <spot@fedoraproject.org> - 1.1-1
- update to 1.1