diff --git a/BZ-1051554-speed-on-404-mirror.patch b/BZ-1051554-speed-on-404-mirror.patch new file mode 100644 index 0000000..b587c3d --- /dev/null +++ b/BZ-1051554-speed-on-404-mirror.patch @@ -0,0 +1,18 @@ +commit fbc995805e9d860366c67819effc3bc7d5d8a8b2 +Author: Zdenek Pavlas +Date: Mon Jan 13 13:20:28 2014 +0100 + + Don't set speed=0 on a new mirror that 404'd. BZ 1051554 + +diff --git a/urlgrabber/grabber.py b/urlgrabber/grabber.py +index ef18d6a..04f1179 100644 +--- a/urlgrabber/grabber.py ++++ b/urlgrabber/grabber.py +@@ -2418,6 +2418,7 @@ class _TH: + speed = (k1 * speed + k2 * dl_size / dl_time) / (k1 + k2) + fail = 0 + elif getattr(ug_err, 'code', None) == 404: ++ if not ts: return # 1st update, avoid speed=0 + fail = 0 # alive, at least + else: + fail += 1 # seems dead diff --git a/python-urlgrabber.spec b/python-urlgrabber.spec new file mode 100644 index 0000000..bccdbc3 --- /dev/null +++ b/python-urlgrabber.spec @@ -0,0 +1,51 @@ +Name: python-urlgrabber +Version: 3.10.1 +Release: 18 +Summary: Cross-protocol urlgrabber +License: LGPLv2+ +Url: http://urlgrabber.baseurl.org/ +Source0: http://urlgrabber.baseurl.org/download/urlgrabber-%{version}.tar.gz +Patch1: BZ-1051554-speed-on-404-mirror.patch + +BuildArch: noarch +BuildRequires: python2-pycurl python2-devel + +%global _description\ +It is a urlgrabber.We can use it to fetch data in three ways.Urlgrab copies\ +files to the local filesystem,urlopen opens the remote file and returns a\ +file object,urlread returns contents of files as string.It is easy to install\ +and use this package. + +%description %_description + +%global _package_python2 python2-urlgrabber + +%package -n %_package_python2 +Summary: %summary +Provides: urlgrabber = %{version}-%{release} +Requires: python2-pycurl +%{?python_provide:%python_provide python2-urlgrabber} + +%description -n %_package_python2 %_description + +%prep +%setup -q -n urlgrabber-%{version} +%patch1 -p1 + +%build +%py2_build + +%install +%py2_install +rm -rf $RPM_BUILD_ROOT/%{_docdir}/urlgrabber-%{version} + +%files -n %_package_python2 +%license LICENSE +%doc README ChangeLog TODO +%{_bindir}/urlgrabber +%{python2_sitelib}/urlgrabber* +%attr(0755,root,root) %{_libexecdir}/urlgrabber-ext-down + +%changelog +* Fri Feb 14 2020 Jiangping Hu - 3.10.1-18 +- Package init diff --git a/urlgrabber-3.10.1.tar.gz b/urlgrabber-3.10.1.tar.gz new file mode 100644 index 0000000..efe223a Binary files /dev/null and b/urlgrabber-3.10.1.tar.gz differ