From 5589527d3058295621a72031f98fd8c95d322a58 Mon Sep 17 00:00:00 2001 From: Seth Vidal Date: Mon, 9 Mar 2009 16:31:12 +0000 Subject: [PATCH] patch for yum ticket 14 - make sure urlgrabber checks file:// urls, too --- python-urlgrabber.spec | 8 ++++++-- urlgrabber-file-checkfunc.patch | 16 ++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 urlgrabber-file-checkfunc.patch diff --git a/python-urlgrabber.spec b/python-urlgrabber.spec index 047aa63..c6f8008 100644 --- a/python-urlgrabber.spec +++ b/python-urlgrabber.spec @@ -3,7 +3,7 @@ Summary: A high-level cross-protocol url-grabber Name: python-urlgrabber Version: 3.0.0 -Release: 12%{?dist} +Release: 13%{?dist} Source0: urlgrabber-%{version}.tar.gz Patch0: urlgrabber-keepalive.patch Patch1: urlgrabber-string-type.patch @@ -13,6 +13,7 @@ Patch4: urlgrabber-progress-ui.patch Patch5: urlgrabber-grab-no-range.patch Patch6: urlgrabber-no-ssl-ok.patch Patch7: urlgrabber-extra-progress.patch +Patch8: urlgrabber-file-checkfunc.patch License: LGPLv2+ Group: Development/Libraries BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root @@ -36,7 +37,7 @@ authentication, proxies and more. %patch5 -p1 %patch6 -p1 %patch7 -p1 - +%patch8 -p1 %build python setup.py build @@ -55,6 +56,9 @@ rm -rf $RPM_BUILD_ROOT %{_bindir}/urlgrabber %changelog +* Mon Mar 9 2009 Seth Vidal +- apply patch for urlgrabber to properly check file:// urls with the checkfunc + * Thu Feb 26 2009 Fedora Release Engineering - 3.0.0-12 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild diff --git a/urlgrabber-file-checkfunc.patch b/urlgrabber-file-checkfunc.patch new file mode 100644 index 0000000..2ffac95 --- /dev/null +++ b/urlgrabber-file-checkfunc.patch @@ -0,0 +1,16 @@ +--- foo/urlgrabber/grabber.py~ 2009-03-09 12:01:21.000000000 -0400 ++++ foo/urlgrabber/grabber.py 2009-03-09 12:01:21.000000000 -0400 +@@ -913,6 +913,13 @@ + raise URLGrabError(3, + _('Not a normal file: %s') % (path, )) + elif not opts.range: ++ if not opts.checkfunc is None: ++ cb_func, cb_args, cb_kwargs = \ ++ self._make_callback(opts.checkfunc) ++ obj = CallbackObject() ++ obj.filename = path ++ obj.url = url ++ apply(cb_func, (obj, )+cb_args, cb_kwargs) + return path + + def retryfunc(opts, url, filename):