From 654185815307af550ce5da849dca797ee1dba208 Mon Sep 17 00:00:00 2001 From: "Tom \"spot\" Callaway" Date: Thu, 3 Mar 2011 12:07:13 -0500 Subject: [PATCH] fix source url 404 bug --- rpmlint-1.1-changeset1836.patch | 21 +++++++++++++++++++++ rpmlint.spec | 11 ++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 rpmlint-1.1-changeset1836.patch diff --git a/rpmlint-1.1-changeset1836.patch b/rpmlint-1.1-changeset1836.patch new file mode 100644 index 0000000..c4bed94 --- /dev/null +++ b/rpmlint-1.1-changeset1836.patch @@ -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]] diff --git a/rpmlint.spec b/rpmlint.spec index d95965f..31ef0f0 100644 --- a/rpmlint.spec +++ b/rpmlint.spec @@ -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 - 1.1-2 +- apply upstream fix for source url aborts (bz 680781) + * Fri Feb 4 2011 Tom Callaway - 1.1-1 - update to 1.1