[rpmlint/f15/master] apply upstream fix for source url aborts (bz 680781)

Tom Callaway spot at fedoraproject.org
Thu Mar 3 17:11:10 UTC 2011


commit ba666780b925fbfbf3e4fd1ad135ac974c653d6f
Author: Tom "spot" Callaway <tcallawa at redhat.com>
Date:   Thu Mar 3 12:12:23 2011 -0500

    apply upstream fix for source url aborts (bz 680781)

 rpmlint-1.1-changeset1836.patch |   21 +++++++++++++++++++++
 rpmlint.spec                    |   11 ++++++++++-
 2 files changed, 31 insertions(+), 1 deletions(-)
---
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 9fb3139..de50879 100644
--- a/rpmlint.spec
+++ b/rpmlint.spec
@@ -1,6 +1,6 @@
 Name:           rpmlint
 Version:        1.1
-Release:        2%{?dist}
+Release:        3%{?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 at fedoraproject.org> - 1.1-3
+- apply upstream fix for source url aborts (bz 680781)
+
 * Wed Feb 09 2011 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.1-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
 


More information about the scm-commits mailing list