aboutsummaryrefslogtreecommitdiff
path: root/www/py-urlgrabber
diff options
context:
space:
mode:
authorNicola Vitale <nivit@FreeBSD.org>2012-07-16 08:51:22 +0000
committerNicola Vitale <nivit@FreeBSD.org>2012-07-16 08:51:22 +0000
commita09dcfecf3672298b1de671a6d42d54298034d38 (patch)
tree19529a027edc4e1168d1a3fbf882a093a415da64 /www/py-urlgrabber
parent680e45a3748711be41d7e0b8f71e79ee9e22a689 (diff)
downloadports-a09dcfecf3672298b1de671a6d42d54298034d38.tar.gz
ports-a09dcfecf3672298b1de671a6d42d54298034d38.zip
- Add a patch (provided by the authors of the program: goo.gl/jorPS )
to fix a bug with the size of PyCurlFileObject - Bump PORTREVISION PR: ports/168917 Submitted by: Anders F Bjoerklund <afb at rpm5.org>
Notes
Notes: svn path=/head/; revision=300931
Diffstat (limited to 'www/py-urlgrabber')
-rw-r--r--www/py-urlgrabber/Makefile2
-rw-r--r--www/py-urlgrabber/files/patch-urlgrabber-grabber.py47
2 files changed, 48 insertions, 1 deletions
diff --git a/www/py-urlgrabber/Makefile b/www/py-urlgrabber/Makefile
index 65367d620730..90a0b9169798 100644
--- a/www/py-urlgrabber/Makefile
+++ b/www/py-urlgrabber/Makefile
@@ -7,7 +7,7 @@
PORTNAME= urlgrabber
PORTVERSION= 3.9.1
-PORTREVISION= 0
+PORTREVISION= 1
CATEGORIES= www python
MASTER_SITES= http://urlgrabber.baseurl.org/download/ \
http://nivi.interfree.it/distfiles/${PORTNAME}/
diff --git a/www/py-urlgrabber/files/patch-urlgrabber-grabber.py b/www/py-urlgrabber/files/patch-urlgrabber-grabber.py
new file mode 100644
index 000000000000..95f5b2b539b4
--- /dev/null
+++ b/www/py-urlgrabber/files/patch-urlgrabber-grabber.py
@@ -0,0 +1,47 @@
+From: Seth Vidal <skvidal@fedoraproject.org>
+Date: Fri, 25 Sep 2009 20:16:08 +0000 (-0400)
+Subject: - fileobject size = 0 not None
+X-Git-Url: http://yum.baseurl.org/gitweb?p=urlgrabber.git;a=commitdiff_plain;h=f4e57ece7ded0f7ad83c8a40fe8423fab7812264;hp=926062a18852bc73686a5ef60307526841df8a32
+
+- fileobject size = 0 not None
+- if the filesize is small enough we could receive the whole thing in on chunk
+ and our max size message would never get out - so we make sure
+- make sure we multiply correctly b/c python is anal
+---
+
+diff --git a/urlgrabber/grabber.py b/urlgrabber/grabber.py
+index e090e90..c4916d5 100644
+--- urlgrabber/grabber.py
++++ urlgrabber/grabber.py
+@@ -1052,7 +1052,7 @@ class PyCurlFileObject():
+ self._reget_length = 0
+ self._prog_running = False
+ self._error = (None, None)
+- self.size = None
++ self.size = 0
+ self._do_open()
+
+
+@@ -1299,6 +1299,12 @@ class PyCurlFileObject():
+ err.code = code
+ err.exception = e
+ raise err
++ else:
++ if self._error[1]:
++ msg = self._error[1]
++ err = URLGRabError(14, msg)
++ err.url = self.url
++ raise err
+
+ def _do_open(self):
+ self.curl_obj = _curl_cache
+@@ -1536,7 +1542,8 @@ class PyCurlFileObject():
+ if self.opts.size: # if we set an opts size use that, no matter what
+ max_size = self.opts.size
+ if not max_size: return False # if we have None for all of the Max then this is dumb
+- if cur > max_size + max_size*.10:
++
++ if cur > int(float(max_size) * 1.10):
+
+ msg = _("Downloaded more than max size for %s: %s > %s") \
+ % (self.url, cur, max_size)