mirror of
https://git.FreeBSD.org/ports.git
synced 2024-11-23 00:43:28 +00:00
- Add a patch from upstream, that fix value of SSL verify host with pycurl
(see http://goo.gl/KGnkXT ) [1], and so bump PORTREVISION - Trim Makefile header - Remove dead link from MASTER_SITES - Remove leading, indefinite article from COMMENT - Add LICENSE (LGPL21) - Convert to the new options framework - Fix WWW field in pkg-descr Required by: Yuri <yuri@rawbw.com> (via private email) [1] Build details: http://goo.gl/7arykr
This commit is contained in:
parent
b893352477
commit
19e7b677b2
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=324776
@ -1,20 +1,17 @@
|
||||
# New ports collection makefile for: py-urlgrabber
|
||||
# Date created: 2007-09-22
|
||||
# Whom: Nicola Vitale <nivit@FreeBSD.org>
|
||||
#
|
||||
# Created by: Nicola Vitale <nivit@FreeBSD.org>
|
||||
# $FreeBSD$
|
||||
#
|
||||
|
||||
PORTNAME= urlgrabber
|
||||
PORTVERSION= 3.9.1
|
||||
PORTREVISION= 1
|
||||
PORTREVISION= 2
|
||||
CATEGORIES= www python
|
||||
MASTER_SITES= http://urlgrabber.baseurl.org/download/ \
|
||||
http://nivi.interfree.it/distfiles/${PORTNAME}/
|
||||
MASTER_SITES= http://urlgrabber.baseurl.org/download/
|
||||
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
|
||||
|
||||
MAINTAINER= nivit@FreeBSD.org
|
||||
COMMENT= A high-level cross-protocol url-grabber
|
||||
COMMENT= High-level cross-protocol url-grabber
|
||||
|
||||
LICENSE= LGPL21
|
||||
|
||||
BUILD_DEPENDS= ${PKGNAMEPREFIX}curl>=7.19.0_1:${PORTSDIR}/ftp/py-curl
|
||||
RUN_DEPENDS= ${PKGNAMEPREFIX}curl>=7.19.0_1:${PORTSDIR}/ftp/py-curl
|
||||
@ -25,8 +22,13 @@ USE_PYDISTUTILS= yes
|
||||
REINPLACE_ARGS= -i.bak -e 's,%%DOCSDIR%%,${DOCSDIR},'
|
||||
DOCSDIR= ${PREFIX}/share/doc/${PYTHON_PKGNAMEPREFIX}${PORTNAME}
|
||||
|
||||
.if defined(NOPORTDOCS)
|
||||
MAKE_ENV= NOPORTDOCS=${NOPORTDOCS}
|
||||
OPTIONSFILE?= ${PORT_DBDIR}/py-${PORTNAME}/options
|
||||
OPTIONS_DEFINE= DOCS
|
||||
|
||||
.include <bsd.port.options.mk>
|
||||
|
||||
.if ${PORT_OPTIONS:MDOCS}
|
||||
MAKE_ENV= INSTALL_DOCS=yes
|
||||
.endif
|
||||
|
||||
post-patch:
|
||||
|
@ -19,7 +19,7 @@
|
||||
if k.startswith('_'): del config[k]
|
||||
|
||||
+ import os
|
||||
+ if not os.environ.has_key('NOPORTDOCS'):
|
||||
+ if os.environ.has_key('INSTALL_DOCS'):
|
||||
+ config.setdefault('data_files', [('%%DOCSDIR%%', ['README','LICENSE', 'TODO', 'ChangeLog'])])
|
||||
+
|
||||
from distutils.core import setup
|
||||
|
@ -1,47 +0,0 @@
|
||||
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)
|
54
www/py-urlgrabber/files/patch-urlgrabber__grabber.py
Normal file
54
www/py-urlgrabber/files/patch-urlgrabber__grabber.py
Normal file
@ -0,0 +1,54 @@
|
||||
--- ./urlgrabber/grabber.py.orig 2009-09-25 18:19:50.000000000 +0200
|
||||
+++ ./urlgrabber/grabber.py 2013-08-15 17:18:28.000000000 +0200
|
||||
@@ -1052,7 +1052,7 @@
|
||||
self._reget_length = 0
|
||||
self._prog_running = False
|
||||
self._error = (None, None)
|
||||
- self.size = None
|
||||
+ self.size = 0
|
||||
self._do_open()
|
||||
|
||||
|
||||
@@ -1127,6 +1127,9 @@
|
||||
if not opts:
|
||||
opts = self.opts
|
||||
|
||||
+ # keepalives
|
||||
+ if not opts.keepalive:
|
||||
+ self.curl_obj.setopt(pycurl.FORBID_REUSE, 1)
|
||||
|
||||
# defaults we're always going to set
|
||||
self.curl_obj.setopt(pycurl.NOPROGRESS, False)
|
||||
@@ -1158,7 +1161,8 @@
|
||||
self.curl_obj.setopt(pycurl.CAPATH, opts.ssl_ca_cert)
|
||||
self.curl_obj.setopt(pycurl.CAINFO, opts.ssl_ca_cert)
|
||||
self.curl_obj.setopt(pycurl.SSL_VERIFYPEER, opts.ssl_verify_peer)
|
||||
- self.curl_obj.setopt(pycurl.SSL_VERIFYHOST, opts.ssl_verify_host)
|
||||
+ if opts.ssl_verify_host: # 1 is meaningless to curl
|
||||
+ self.curl_obj.setopt(pycurl.SSL_VERIFYHOST, 2)
|
||||
if opts.ssl_key:
|
||||
self.curl_obj.setopt(pycurl.SSLKEY, opts.ssl_key)
|
||||
if opts.ssl_key_type:
|
||||
@@ -1299,6 +1303,12 @@
|
||||
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 +1546,8 @@
|
||||
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)
|
@ -6,5 +6,4 @@ a clean interface to protocol-independant file-access. Best of all,
|
||||
urlgrabber takes care of all those pesky file-fetching details, and
|
||||
lets you focus on whatever it is that your program is written to do!
|
||||
|
||||
Author: Michael D. Stenner, Ryan Tomayko
|
||||
WWW: http://urlgrabber.baseurl.org/
|
||||
WWW: http://urlgrabber.baseurl.org/
|
||||
|
Loading…
Reference in New Issue
Block a user