public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: net-proxy/http-replicator/, net-proxy/http-replicator/files/
@ 2016-03-23 11:00 Sam Jorna
  0 siblings, 0 replies; 4+ messages in thread
From: Sam Jorna @ 2016-03-23 11:00 UTC (permalink / raw
  To: gentoo-commits

commit:     91d6d053b55f3c230fa90dc257d0bc994c3bc5e5
Author:     Sam Jorna <wraeth <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 23 10:58:13 2016 +0000
Commit:     Sam Jorna <wraeth <AT> gentoo <DOT> org>
CommitDate: Wed Mar 23 10:58:36 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=91d6d053

net-proxy/http-replicator: revbump, bug 442874

Adds X-Unique-Cache-Name header to try and catch files based on their
saved name in DISTFILES. Additionally bumps ebuild to EAPI6 and elogs
information for required setup. Ebuild supplied by Matthew Ogilvie.

Gentoo-bug: 442874
Package-Manager: portage-2.2.28
Signed-off-by: Sam Jorna <wraeth <AT> gentoo.org>

 .../http-replicator-3-missing-directory.patch      | 51 +++++++++++++
 .../http-replicator-3-unique-cache-name.patch      | 31 ++++++++
 .../http-replicator/http-replicator-3.0-r5.ebuild  | 85 ++++++++++++++++++++++
 3 files changed, 167 insertions(+)

diff --git a/net-proxy/http-replicator/files/http-replicator-3-missing-directory.patch b/net-proxy/http-replicator/files/http-replicator-3-missing-directory.patch
new file mode 100644
index 0000000..37c2ce2
--- /dev/null
+++ b/net-proxy/http-replicator/files/http-replicator-3-missing-directory.patch
@@ -0,0 +1,51 @@
+Author: Matthew Ogilvie
+Date:   Sat Jan 17 09:24:34 2015 -0700
+
+    add some suggestions to the missing-directory error message
+    
+    Also wait until directory confirmed before forking.
+    
+    See gentoo bug 502574 and bug 442874
+
+diff --git a/http-replicator b/http-replicator
+index bbc163c..81e254d 100755
+--- a/http-replicator
++++ b/http-replicator
+@@ -636,13 +636,6 @@ def main ():
+ 				parser.error('user %r does not exist' % options.user)
+ 			except OSError:
+ 				parser.error('no permission for changing to user %r' % options.user)
+-		pid = os.fork() # fork process
+-		if pid: # parent process
+-			pidfile.write(str(pid)) # store child's pid
+-			pidfile.close()
+-			return
+-		else:
+-			signal.signal(signal.SIGHUP, signal.SIG_IGN)
+ 	else:
+ 		handler = logging.StreamHandler(sys.stdout) # log to stdout
+ 		handler.setFormatter(logging.Formatter('%(levelname)s: %(name)s %(message)s'))
+@@ -651,10 +644,22 @@ def main ():
+ 	try:
+ 		os.chdir(options.dir) # change to cache directory
+ 	except OSError:
+-		parser.error('invalid directory %r' % options.dir)
++		parser.error('invalid directory %r\n' \
++		             'Try running repcacheman, and/or see\n' \
++		             'http://forums.gentoo.org/viewtopic-t-173226.html' \
++				 % options.dir)
+ 	if not os.access(os.curdir, os.R_OK | os.W_OK): # check permissions for cache directory
+ 		parser.error('no read/write permission for directory %r' % options.dir)
+ 
++	if options.daemon:
++		pid = os.fork() # fork process
++		if pid: # parent process
++			pidfile.write(str(pid)) # store child's pid
++			pidfile.close()
++			return
++		else:
++			signal.signal(signal.SIGHUP, signal.SIG_IGN)
++
+ 	sys.stdout = sys.stderr = open('/dev/null', 'w') # redirect all output to bit bucket
+ 	logging.root.name = 'HttpReplicator'
+ 	try:

diff --git a/net-proxy/http-replicator/files/http-replicator-3-unique-cache-name.patch b/net-proxy/http-replicator/files/http-replicator-3-unique-cache-name.patch
new file mode 100644
index 0000000..3ad0529
--- /dev/null
+++ b/net-proxy/http-replicator/files/http-replicator-3-unique-cache-name.patch
@@ -0,0 +1,31 @@
+Author: Matthew Ogilvie
+Date:   Sun Dec 28 20:14:15 2014 -0700
+
+    honor x-unique-cache-name header in flat mode, if present
+    
+    This allows things like different versions of the adobe-flash
+    downloader that are given different names in a flat download
+    directory (like in gentoo) to work in an http-replicator cache
+    as well.  As long as the fetcher passes the custom name through
+    the experimental header...
+    
+    See gentoo bug # 442874
+
+diff --git a/http-replicator b/http-replicator
+index 19ae427..befe9f2 100755
+--- a/http-replicator
++++ b/http-replicator
+@@ -311,7 +311,12 @@ class HttpClient (Http):
+ 			self.log.info('requested range: bytes %s to %s' % self.range) # log request
+ 
+ 		head = ''
+-		for tail in self.path.split('/'): # iterate over items in path
++		adjUrlPath = self.path
++		if not self.direct and self.flat:
++			uniqueCacheName = body.get('x-unique-cache-name')
++			if uniqueCacheName:
++				adjUrlPath = uniqueCacheName
++		for tail in adjUrlPath.split('/'): # iterate over items in path
+ 			head = os.path.join(head, tail) # build target path
+ 			if head in self.alias: # path up till now hos an alias
+ 				head = self.alias[head] # replace by alias

diff --git a/net-proxy/http-replicator/http-replicator-3.0-r5.ebuild b/net-proxy/http-replicator/http-replicator-3.0-r5.ebuild
new file mode 100644
index 0000000..70b763e
--- /dev/null
+++ b/net-proxy/http-replicator/http-replicator-3.0-r5.ebuild
@@ -0,0 +1,85 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+PYTHON_COMPAT=( python2_7 ) # not 2.6 bug #33907, not 3.0 bug #411083
+inherit eutils python-single-r1 systemd
+
+MY_P="${PN}_${PV}"
+
+DESCRIPTION="Proxy cache for Gentoo packages"
+HOMEPAGE="http://sourceforge.net/projects/http-replicator"
+SRC_URI="mirror://sourceforge/http-replicator/${MY_P}.tar.gz"
+S="${WORKDIR}/${MY_P}"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~sparc ~x86"
+
+PATCHES=(
+	"${FILESDIR}/http-replicator-3.0-sighup.patch"
+	"${FILESDIR}/http-replicator-3-unique-cache-name.patch"
+	"${FILESDIR}/http-replicator-3-missing-directory.patch"
+)
+
+src_install(){
+	python-single-r1_pkg_setup
+
+	# Daemon and repcacheman into /usr/bin
+	python_scriptinto /usr/bin
+	python_doexe http-replicator
+	python_newexe "${FILESDIR}/http-replicator-3.0-repcacheman-0.44-r2" repcacheman.py
+
+	exeinto /usr/bin
+	newexe "${FILESDIR}/http-replicator-3.0-callrepcacheman-0.1" repcacheman
+
+	# init.d scripts
+	newinitd "${FILESDIR}/http-replicator-3.0.init" http-replicator
+	newconfd "${FILESDIR}/http-replicator-3.0.conf" http-replicator
+
+	systemd_dounit "${FILESDIR}"/http-replicator.service
+	systemd_install_serviced "${FILESDIR}"/http-replicator.service.conf
+
+	# Docs
+	dodoc README debian/changelog
+
+	# Man Page - Not Gentooified yet
+	doman http-replicator.1
+
+	insinto /etc/logrotate.d
+	newins debian/logrotate http-replicator
+}
+
+pkg_postinst() {
+	elog
+	ewarn "Before starting http-replicator, please follow the next few steps:"
+	elog "- Modify /etc/conf.d/http-replicator if required."
+	ewarn "- Run /usr/bin/repcacheman to set up the cache."
+	elog "- Add http_proxy=\"http://serveraddress:8080\" to make.conf on"
+	elog "  the server as well as on the client machines."
+	elog "- Make sure FETCHCOMMAND adds the X-unique-cache-name header to"
+	elog "  HTTP requests in make.conf (or maybe portage will add it to"
+	elog "  the default make.globals someday).  Example:"
+	elog '   FETCHCOMMAND="wget -t 3 -T 60 --passive-ftp -O \"\${DISTDIR}/\${FILE}\" --header=\"X-unique-cache-name: \${FILE}\" \"\${URI}\""'
+	elog '   RESUMECOMMAND="wget -c -t 3 -T 60 --passive-ftp -O \"\${DISTDIR}/\${FILE}\" --header=\"X-unique-cache-name: \${FILE}\" \"\${URI}\""'
+	elog "- Arrange to periodically run repcacheman on this server,"
+	elog "  to clean up the local /usr/portage/distfiles directory."
+	elog "- Arrange to periodically run something like the following"
+	elog "  on this server.  'eclean' is in app-portage/gentoolkit."
+	elog "    ( export DISTDIR=/var/cache/http-replicator/"
+	elog "      eclean -i distfiles )"
+	elog "- Even with FETCHCOMMAND fixing most cases, occasionally"
+	elog "  an older invalid version of a file may end up in the cache,"
+	elog "  causing checksum failures when portage tries to fetch"
+	elog "  it.  To recover, either use eclean (above), manually delete"
+	elog "  the relevant file from the cache, or temporarily comment"
+	elog "  out the http_proxy setting.  Commenting only requires"
+	elog "  access to client config, not server cache."
+	elog "- Make sure GENTOO_MIRRORS in /etc/portage/make.conf starts"
+	elog "  with several good http mirrors."
+	elog
+	elog "For more information please refer to the following forum thread:"
+	elog "  http://forums.gentoo.org/viewtopic-t-173226.html"
+	elog
+}


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-proxy/http-replicator/, net-proxy/http-replicator/files/
@ 2016-05-03 19:17 Austin English
  0 siblings, 0 replies; 4+ messages in thread
From: Austin English @ 2016-05-03 19:17 UTC (permalink / raw
  To: gentoo-commits

commit:     dfe567177d7f561dc921497110e7f65b63701bb9
Author:     Austin English <wizardedit <AT> gentoo <DOT> org>
AuthorDate: Tue May  3 19:03:54 2016 +0000
Commit:     Austin English <wizardedit <AT> gentoo <DOT> org>
CommitDate: Tue May  3 19:17:01 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dfe56717

net-proxy/http-replicator: use #!/sbin/openrc-run instead of #!/sbin/runscript

Gentoo-Bug: https://bugs.gentoo.org/573846

Package-Manager: portage-2.2.26

 .../http-replicator/files/http-replicator-3.0.init |  4 +-
 .../files/http-replicator-4.0_alpha2-r3.init       |  4 +-
 .../http-replicator/http-replicator-3.0-r6.ebuild  | 85 ++++++++++++++++++++++
 .../http-replicator-4.0_alpha2-r5.ebuild           | 69 ++++++++++++++++++
 4 files changed, 158 insertions(+), 4 deletions(-)

diff --git a/net-proxy/http-replicator/files/http-replicator-3.0.init b/net-proxy/http-replicator/files/http-replicator-3.0.init
index 85f773e..1aac72b 100644
--- a/net-proxy/http-replicator/files/http-replicator-3.0.init
+++ b/net-proxy/http-replicator/files/http-replicator-3.0.init
@@ -1,5 +1,5 @@
-#!/sbin/runscript
-# Copyright 1999-2004 Gentoo Technologies, Inc.
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 

diff --git a/net-proxy/http-replicator/files/http-replicator-4.0_alpha2-r3.init b/net-proxy/http-replicator/files/http-replicator-4.0_alpha2-r3.init
index b1eae99..21d1aed 100644
--- a/net-proxy/http-replicator/files/http-replicator-4.0_alpha2-r3.init
+++ b/net-proxy/http-replicator/files/http-replicator-4.0_alpha2-r3.init
@@ -1,5 +1,5 @@
-#!/sbin/runscript
-# Copyright 1999-2013 Gentoo Technologies, Inc.
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 

diff --git a/net-proxy/http-replicator/http-replicator-3.0-r6.ebuild b/net-proxy/http-replicator/http-replicator-3.0-r6.ebuild
new file mode 100644
index 0000000..70b763e
--- /dev/null
+++ b/net-proxy/http-replicator/http-replicator-3.0-r6.ebuild
@@ -0,0 +1,85 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+PYTHON_COMPAT=( python2_7 ) # not 2.6 bug #33907, not 3.0 bug #411083
+inherit eutils python-single-r1 systemd
+
+MY_P="${PN}_${PV}"
+
+DESCRIPTION="Proxy cache for Gentoo packages"
+HOMEPAGE="http://sourceforge.net/projects/http-replicator"
+SRC_URI="mirror://sourceforge/http-replicator/${MY_P}.tar.gz"
+S="${WORKDIR}/${MY_P}"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~sparc ~x86"
+
+PATCHES=(
+	"${FILESDIR}/http-replicator-3.0-sighup.patch"
+	"${FILESDIR}/http-replicator-3-unique-cache-name.patch"
+	"${FILESDIR}/http-replicator-3-missing-directory.patch"
+)
+
+src_install(){
+	python-single-r1_pkg_setup
+
+	# Daemon and repcacheman into /usr/bin
+	python_scriptinto /usr/bin
+	python_doexe http-replicator
+	python_newexe "${FILESDIR}/http-replicator-3.0-repcacheman-0.44-r2" repcacheman.py
+
+	exeinto /usr/bin
+	newexe "${FILESDIR}/http-replicator-3.0-callrepcacheman-0.1" repcacheman
+
+	# init.d scripts
+	newinitd "${FILESDIR}/http-replicator-3.0.init" http-replicator
+	newconfd "${FILESDIR}/http-replicator-3.0.conf" http-replicator
+
+	systemd_dounit "${FILESDIR}"/http-replicator.service
+	systemd_install_serviced "${FILESDIR}"/http-replicator.service.conf
+
+	# Docs
+	dodoc README debian/changelog
+
+	# Man Page - Not Gentooified yet
+	doman http-replicator.1
+
+	insinto /etc/logrotate.d
+	newins debian/logrotate http-replicator
+}
+
+pkg_postinst() {
+	elog
+	ewarn "Before starting http-replicator, please follow the next few steps:"
+	elog "- Modify /etc/conf.d/http-replicator if required."
+	ewarn "- Run /usr/bin/repcacheman to set up the cache."
+	elog "- Add http_proxy=\"http://serveraddress:8080\" to make.conf on"
+	elog "  the server as well as on the client machines."
+	elog "- Make sure FETCHCOMMAND adds the X-unique-cache-name header to"
+	elog "  HTTP requests in make.conf (or maybe portage will add it to"
+	elog "  the default make.globals someday).  Example:"
+	elog '   FETCHCOMMAND="wget -t 3 -T 60 --passive-ftp -O \"\${DISTDIR}/\${FILE}\" --header=\"X-unique-cache-name: \${FILE}\" \"\${URI}\""'
+	elog '   RESUMECOMMAND="wget -c -t 3 -T 60 --passive-ftp -O \"\${DISTDIR}/\${FILE}\" --header=\"X-unique-cache-name: \${FILE}\" \"\${URI}\""'
+	elog "- Arrange to periodically run repcacheman on this server,"
+	elog "  to clean up the local /usr/portage/distfiles directory."
+	elog "- Arrange to periodically run something like the following"
+	elog "  on this server.  'eclean' is in app-portage/gentoolkit."
+	elog "    ( export DISTDIR=/var/cache/http-replicator/"
+	elog "      eclean -i distfiles )"
+	elog "- Even with FETCHCOMMAND fixing most cases, occasionally"
+	elog "  an older invalid version of a file may end up in the cache,"
+	elog "  causing checksum failures when portage tries to fetch"
+	elog "  it.  To recover, either use eclean (above), manually delete"
+	elog "  the relevant file from the cache, or temporarily comment"
+	elog "  out the http_proxy setting.  Commenting only requires"
+	elog "  access to client config, not server cache."
+	elog "- Make sure GENTOO_MIRRORS in /etc/portage/make.conf starts"
+	elog "  with several good http mirrors."
+	elog
+	elog "For more information please refer to the following forum thread:"
+	elog "  http://forums.gentoo.org/viewtopic-t-173226.html"
+	elog
+}

diff --git a/net-proxy/http-replicator/http-replicator-4.0_alpha2-r5.ebuild b/net-proxy/http-replicator/http-replicator-4.0_alpha2-r5.ebuild
new file mode 100644
index 0000000..607e3e2
--- /dev/null
+++ b/net-proxy/http-replicator/http-replicator-4.0_alpha2-r5.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils python-r1 systemd
+
+MY_P="${PN}_${PV/_/}"
+
+DESCRIPTION="Proxy cache for Gentoo packages"
+HOMEPAGE="http://sourceforge.net/projects/http-replicator"
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~sparc ~x86"
+
+S="${WORKDIR}/${MY_P}"
+
+# Tests downloads files as well as breaks, should be turned into local tests.
+RESTRICT="test"
+
+src_prepare() {
+	epatch "${FILESDIR}"/${PN}-4.0_alpha2-r3-pid.patch
+}
+
+src_test() {
+	./unit-test && die
+}
+
+src_install(){
+	python_foreach_impl python_doscript http-replicator
+
+	newbin "${FILESDIR}"/${PN}-3.0-callrepcacheman-0.1 repcacheman
+
+	python_foreach_impl python_domodule *.py
+
+	python_foreach_impl python_newscript "${FILESDIR}"/${PN}-3.0-repcacheman-0.44-r2 repcacheman.py
+
+	newinitd "${FILESDIR}"/${PN}-4.0_alpha2-r3.init http-replicator
+	newconfd "${FILESDIR}"/${PN}-4.0_alpha2-r2.conf http-replicator
+
+	systemd_dounit "${FILESDIR}"/http-replicator.service
+	systemd_install_serviced "${FILESDIR}"/http-replicator.service.conf
+
+	dodoc README.user README.devel RELNOTES
+}
+
+pkg_postinst() {
+	echo
+	einfo "Before starting ${PN}, please follow the next few steps:"
+	einfo
+	einfo "- Modify /etc/conf.d/${PN} if required."
+	einfo "- Run \`repcacheman\` to set up the cache."
+	einfo "- Add HTTP_PROXY=\"http://serveraddress:8080\" to make.conf on"
+	einfo "  the server as well as on the client machines."
+	einfo "- Make sure GENTOO_MIRRORS in /etc/portage/make.conf"
+	einfo "  starts with several good HTTP mirrors."
+	einfo
+	einfo "For more information please refer to the following forum thread:"
+	einfo
+	einfo "  https://forums.gentoo.org/viewtopic-t-173226.html"
+	einfo
+	einfo "Starting with 4.x releases, the conf.d parameters have changed."
+	echo
+}


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-proxy/http-replicator/, net-proxy/http-replicator/files/
@ 2018-11-04 12:34 Pacho Ramos
  0 siblings, 0 replies; 4+ messages in thread
From: Pacho Ramos @ 2018-11-04 12:34 UTC (permalink / raw
  To: gentoo-commits

commit:     0c626c6625208d815bb9c86256424bec1b10b842
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Sun Nov  4 12:00:16 2018 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Sun Nov  4 12:33:51 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0c626c66

net-proxy/http-replicator: Fix ipv6 support

Thanks-to: spock128 <AT> gmail.com
Closes: https://bugs.gentoo.org/669078
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>
Package-Manager: Portage-2.3.51, Repoman-2.3.11

 .../files/http-replicator-4.0_alpha2-ipv6.patch    | 68 +++++++++++++++++++
 .../http-replicator-4.0_alpha2-r7.ebuild           | 78 ++++++++++++++++++++++
 2 files changed, 146 insertions(+)

diff --git a/net-proxy/http-replicator/files/http-replicator-4.0_alpha2-ipv6.patch b/net-proxy/http-replicator/files/http-replicator-4.0_alpha2-ipv6.patch
new file mode 100644
index 00000000000..906844fd958
--- /dev/null
+++ b/net-proxy/http-replicator/files/http-replicator-4.0_alpha2-ipv6.patch
@@ -0,0 +1,68 @@
+diff -ur a/fiber.py b/fiber.py
+--- a/fiber.py	2018-10-27 12:52:10.536264605 -0400
++++ b/fiber.py	2018-10-27 12:57:26.688730570 -0400
+@@ -180,10 +180,10 @@
+   os.dup2( nul.fileno(), sys.stdin.fileno()  )
+ 
+ 
+-def spawn( generator, port, debug, log, pidfile ):
++def spawn( generator, port, debug, log, pidfile, listenfamily ):
+ 
+   try:
+-    listener = socket.socket( socket.AF_INET, socket.SOCK_STREAM )
++    listener = socket.socket( listenfamily, socket.SOCK_STREAM )
+     listener.setblocking( 0 )
+     listener.setsockopt( socket.SOL_SOCKET, socket.SO_REUSEADDR, listener.getsockopt( socket.SOL_SOCKET, socket.SO_REUSEADDR ) | 1 )
+     listener.bind( ( '', port ) )
+diff -ur a/http-replicator b/http-replicator
+--- a/http-replicator	2018-10-27 12:52:10.542931816 -0400
++++ b/http-replicator	2018-10-27 12:59:36.345978943 -0400
+@@ -9,7 +9,7 @@
+ 
+ def Replicator( client, address ):
+ 
+-  print 'Accepted request from %s:%i' % address
++  print 'Accepted request from [%s]:%i' % address[0:2]
+ 
+   request = Request.HttpRequest()
+   while not request.Protocol:
+@@ -60,4 +60,4 @@
+   print 'Transaction successfully completed'
+ 
+ 
+-fiber.spawn( Replicator, Params.PORT, Params.DEBUG, Params.LOG, Params.PIDFILE )
++fiber.spawn( Replicator, Params.PORT, Params.DEBUG, Params.LOG, Params.PIDFILE, Params.LISTENFAMILY )
+diff -ur a/Params.py b/Params.py
+--- a/Params.py	2018-10-27 12:52:10.549599026 -0400
++++ b/Params.py	2018-10-27 12:55:31.772685822 -0400
+@@ -9,6 +9,7 @@
+ TIMEOUT = 15
+ PIDFILE = False
+ FAMILY = socket.AF_INET
++LISTENFAMILY = socket.AF_INET
+ FLAT = False
+ STATIC = False
+ ONLINE = True
+@@ -63,6 +64,7 @@
+       sys.exit( 'Error: %s requires a positive numerical argument' % _arg )
+   elif _arg in ( '-6', '--ipv6' ):
+     FAMILY = socket.AF_UNSPEC
++    LISTENFAMILY = socket.AF_INET6
+   elif _arg == '--flat':
+     FLAT = True
+   elif _arg == '--static':
+diff --git a/Protocol.py b/Protocol.py
+--- a/Protocol.py
++++ b/Protocol.py
+@@ -13,7 +13,7 @@ def connect( addr ):
+ 
+   family, socktype, proto, canonname, sockaddr = DNSCache[ addr ][ 0 ]
+ 
+-  print 'Connecting to %s:%i' % sockaddr
++  print 'Connecting to [%s]:%i' % sockaddr[0:2]
+   sock = socket.socket( family, socktype, proto )
+   sock.setblocking( 0 )
+   sock.connect_ex( sockaddr )
+-- 
+2.18.1
+

diff --git a/net-proxy/http-replicator/http-replicator-4.0_alpha2-r7.ebuild b/net-proxy/http-replicator/http-replicator-4.0_alpha2-r7.ebuild
new file mode 100644
index 00000000000..d1b5659c554
--- /dev/null
+++ b/net-proxy/http-replicator/http-replicator-4.0_alpha2-r7.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+PYTHON_COMPAT=( python2_7 )
+
+inherit python-r1 readme.gentoo-r1 systemd
+
+MY_P="${PN}_${PV/_/}"
+
+DESCRIPTION="Proxy cache for Gentoo packages"
+HOMEPAGE="https://sourceforge.net/projects/http-replicator"
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~sparc ~x86"
+IUSE=""
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="${PYTHON_DEPS}
+	sys-apps/portage[${PYTHON_USEDEP}]
+"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/${MY_P}"
+
+# Tests downloads files as well as breaks, should be turned into local tests.
+RESTRICT="test"
+
+DISABLE_AUTOFORMATTING="yes"
+DOC_CONTENTS="
+Before starting ${PN}, please follow the next few steps:
+
+- Modify /etc/conf.d/${PN} if required.
+- Run \`repcacheman\` to set up the cache.
+- Add HTTP_PROXY=\"http://serveraddress:8080\" to make.conf on
+the server as well as on the client machines.
+- Make sure GENTOO_MIRRORS in /etc/portage/make.conf
+starts with several good HTTP mirrors.
+
+For more information please refer to the following forum thread:
+https://forums.gentoo.org/viewtopic-t-173226.html
+
+Starting with 4.x releases, the conf.d parameters have changed.
+"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-4.0_alpha2-r3-pid.patch
+	"${FILESDIR}"/${PN}-4.0_alpha2-ipv6.patch #669078
+)
+
+src_test() {
+	./unit-test && die
+}
+
+src_install() {
+	python_foreach_impl python_doscript http-replicator
+
+	newbin "${FILESDIR}"/${PN}-3.0-callrepcacheman-0.1 repcacheman
+
+	python_foreach_impl python_domodule *.py
+
+	python_foreach_impl python_newscript "${FILESDIR}"/${PN}-3.0-repcacheman-0.44-r2 repcacheman.py
+
+	newinitd "${FILESDIR}"/${PN}-4.0_alpha2-r3.init http-replicator
+	newconfd "${FILESDIR}"/${PN}-4.0_alpha2-r2.conf http-replicator
+
+	systemd_dounit "${FILESDIR}"/http-replicator.service
+	systemd_install_serviced "${FILESDIR}"/http-replicator.service.conf
+
+	dodoc README.user README.devel RELNOTES
+	readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+	readme.gentoo_print_elog
+}


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-proxy/http-replicator/, net-proxy/http-replicator/files/
@ 2019-02-23  9:43 Pacho Ramos
  0 siblings, 0 replies; 4+ messages in thread
From: Pacho Ramos @ 2019-02-23  9:43 UTC (permalink / raw
  To: gentoo-commits

commit:     3b8b8f6ec45e0220e5b841c96f89f52c6c5e02a5
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 23 09:33:54 2019 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Sat Feb 23 09:33:54 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3b8b8f6e

net-proxy/http-replicator: Drop old

Package-Manager: Portage-2.3.62, Repoman-2.3.12
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>

 net-proxy/http-replicator/Manifest                 |  1 -
 .../http-replicator-3-missing-directory.patch      | 51 ------------
 .../http-replicator-3-unique-cache-name.patch      | 31 --------
 .../files/http-replicator-3.0-sighup.patch         | 20 -----
 .../http-replicator/files/http-replicator-3.0.conf | 46 -----------
 .../http-replicator/files/http-replicator-3.0.init | 20 -----
 .../http-replicator/http-replicator-3.0-r7.ebuild  | 93 ----------------------
 7 files changed, 262 deletions(-)

diff --git a/net-proxy/http-replicator/Manifest b/net-proxy/http-replicator/Manifest
index 460a0f3b65b..8c075058ba4 100644
--- a/net-proxy/http-replicator/Manifest
+++ b/net-proxy/http-replicator/Manifest
@@ -1,2 +1 @@
-DIST http-replicator_3.0.tar.gz 39291 BLAKE2B a97d8b6b32f5d4ca4feefa9abaa7da7cb6570f76566c79d7371134c0edd74b2333a02480deff02fa1bf5b6cd6f2bfbfe4aaa649633d70bd2efbdd22701422651 SHA512 d98a608c38201db6f2d8ba809a4777ab5588f5ed395882bdf542c2788df1770c61a2de160604c09297d847f2c73463ba0530d7f2c2e482467f8e8f35be068d57
 DIST http-replicator_4.0alpha2.tgz 27575 BLAKE2B 48138bc8fa9695ddb31ce89c4638adda4a1d1b58c904cd98d0ee1dbab006f79ef7d19495db8eb4de0113f8e45da425950524c48ec9e3e864d8595ccdef9f7cfa SHA512 437e0cc881af0cb8f84bfd1366bb6edeee4f76112c4b2ac2af4bcb8809462852b96e9c99e04c8f370492c9e1eb33ddc68a85c4f09b073694242cd6c05b4d3a6c

diff --git a/net-proxy/http-replicator/files/http-replicator-3-missing-directory.patch b/net-proxy/http-replicator/files/http-replicator-3-missing-directory.patch
deleted file mode 100644
index 37c2ce2361f..00000000000
--- a/net-proxy/http-replicator/files/http-replicator-3-missing-directory.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-Author: Matthew Ogilvie
-Date:   Sat Jan 17 09:24:34 2015 -0700
-
-    add some suggestions to the missing-directory error message
-    
-    Also wait until directory confirmed before forking.
-    
-    See gentoo bug 502574 and bug 442874
-
-diff --git a/http-replicator b/http-replicator
-index bbc163c..81e254d 100755
---- a/http-replicator
-+++ b/http-replicator
-@@ -636,13 +636,6 @@ def main ():
- 				parser.error('user %r does not exist' % options.user)
- 			except OSError:
- 				parser.error('no permission for changing to user %r' % options.user)
--		pid = os.fork() # fork process
--		if pid: # parent process
--			pidfile.write(str(pid)) # store child's pid
--			pidfile.close()
--			return
--		else:
--			signal.signal(signal.SIGHUP, signal.SIG_IGN)
- 	else:
- 		handler = logging.StreamHandler(sys.stdout) # log to stdout
- 		handler.setFormatter(logging.Formatter('%(levelname)s: %(name)s %(message)s'))
-@@ -651,10 +644,22 @@ def main ():
- 	try:
- 		os.chdir(options.dir) # change to cache directory
- 	except OSError:
--		parser.error('invalid directory %r' % options.dir)
-+		parser.error('invalid directory %r\n' \
-+		             'Try running repcacheman, and/or see\n' \
-+		             'http://forums.gentoo.org/viewtopic-t-173226.html' \
-+				 % options.dir)
- 	if not os.access(os.curdir, os.R_OK | os.W_OK): # check permissions for cache directory
- 		parser.error('no read/write permission for directory %r' % options.dir)
- 
-+	if options.daemon:
-+		pid = os.fork() # fork process
-+		if pid: # parent process
-+			pidfile.write(str(pid)) # store child's pid
-+			pidfile.close()
-+			return
-+		else:
-+			signal.signal(signal.SIGHUP, signal.SIG_IGN)
-+
- 	sys.stdout = sys.stderr = open('/dev/null', 'w') # redirect all output to bit bucket
- 	logging.root.name = 'HttpReplicator'
- 	try:

diff --git a/net-proxy/http-replicator/files/http-replicator-3-unique-cache-name.patch b/net-proxy/http-replicator/files/http-replicator-3-unique-cache-name.patch
deleted file mode 100644
index 3ad0529ed16..00000000000
--- a/net-proxy/http-replicator/files/http-replicator-3-unique-cache-name.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-Author: Matthew Ogilvie
-Date:   Sun Dec 28 20:14:15 2014 -0700
-
-    honor x-unique-cache-name header in flat mode, if present
-    
-    This allows things like different versions of the adobe-flash
-    downloader that are given different names in a flat download
-    directory (like in gentoo) to work in an http-replicator cache
-    as well.  As long as the fetcher passes the custom name through
-    the experimental header...
-    
-    See gentoo bug # 442874
-
-diff --git a/http-replicator b/http-replicator
-index 19ae427..befe9f2 100755
---- a/http-replicator
-+++ b/http-replicator
-@@ -311,7 +311,12 @@ class HttpClient (Http):
- 			self.log.info('requested range: bytes %s to %s' % self.range) # log request
- 
- 		head = ''
--		for tail in self.path.split('/'): # iterate over items in path
-+		adjUrlPath = self.path
-+		if not self.direct and self.flat:
-+			uniqueCacheName = body.get('x-unique-cache-name')
-+			if uniqueCacheName:
-+				adjUrlPath = uniqueCacheName
-+		for tail in adjUrlPath.split('/'): # iterate over items in path
- 			head = os.path.join(head, tail) # build target path
- 			if head in self.alias: # path up till now hos an alias
- 				head = self.alias[head] # replace by alias

diff --git a/net-proxy/http-replicator/files/http-replicator-3.0-sighup.patch b/net-proxy/http-replicator/files/http-replicator-3.0-sighup.patch
deleted file mode 100644
index 969bbc91f9d..00000000000
--- a/net-proxy/http-replicator/files/http-replicator-3.0-sighup.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- a/http-replicator	2007-07-09 20:09:44.000000000 +0200
-+++ b/http-replicator	2007-07-09 20:11:48.433913445 +0200
-@@ -5,7 +5,7 @@
- #  Because of this the server runs as a single process, multiplexing I/O with its various client and server connections within a single process/thread.
- #  According to the readme <http://www.nightmare.com/medusa/README.html> this means it is capable of smoother and higher performance than most other servers, while placing a dramatically reduced load on the server machine.
- 
--import asyncore, socket, os, time, calendar, sys, re, optparse, logging
-+import asyncore, socket, os, time, calendar, sys, re, optparse, logging, signal
- 
- #  LISTENER
- #
-@@ -636,6 +636,8 @@
- 			pidfile.write(str(pid)) # store child's pid
- 			pidfile.close()
- 			return
-+		else:
-+			signal.signal(signal.SIGHUP, signal.SIG_IGN)
- 	else:
- 		handler = logging.StreamHandler(sys.stdout) # log to stdout
- 		handler.setFormatter(logging.Formatter('%(levelname)s: %(name)s %(message)s'))

diff --git a/net-proxy/http-replicator/files/http-replicator-3.0.conf b/net-proxy/http-replicator/files/http-replicator-3.0.conf
deleted file mode 100644
index 35671fd262c..00000000000
--- a/net-proxy/http-replicator/files/http-replicator-3.0.conf
+++ /dev/null
@@ -1,46 +0,0 @@
-## Config file for http-replicator
-## sourced by init scripts automatically
-## GENERAL_OPTS used by repcacheman
-## DAEMON_OPTS used by http-replicator
-
-
-## Set the cache dir
-GENERAL_OPTS="--dir /var/cache/http-replicator"
-
-## Change UID/GID to user after opening the log and pid file.
-## 'user' must have read/write access to cache dir:
-GENERAL_OPTS="$GENERAL_OPTS --user portage"
-
-## Don't change or comment this out:
-DAEMON_OPTS="$GENERAL_OPTS"
-
-## Do you need a proxy to reach the internet?
-## This will forward requests to an external proxy server:
-## Use one of the following, not both:
-#DAEMON_OPTS="$DAEMON_OPTS --external somehost:1234"
-#DAEMON_OPTS="$DAEMON_OPTS --external username:password@host:port"
-
-## Local dir to serve clients.  Great for serving binary packages
-## See PKDIR and PORTAGE_BINHOST settings in 'man make.conf'
-## --alias /path/to/serve:location will make /path/to/serve
-## browsable at http://http-replicator.com:port/location
-DAEMON_OPTS="$DAEMON_OPTS --alias /usr/portage/packages:packages"
-
-## Dir to hold the log file:
-DAEMON_OPTS="$DAEMON_OPTS --log /var/log/http-replicator.log"
-
-## Make the log messages less and less verbose.
-## Up to four times to make it extremely quiet.
-#DAEMON_OPTS="$DAEMON_OPTS --quiet"
-#DAEMON_OPTS="$DAEMON_OPTS --quiet"
-
-## Make the log messages extra verbose for debugging.
-#DAEMON_OPTS="$DAEMON_OPTS --debug"
-
-## The ip addresses from which access is allowed. Can be used as many times
-## as necessary. Access from localhost is allowed by default.
-DAEMON_OPTS="$DAEMON_OPTS --ip 192.168.*.*"
-DAEMON_OPTS="$DAEMON_OPTS --ip 10.*.*.*"
-
-## The proxy port on which the server listens for http requests:
-DAEMON_OPTS="$DAEMON_OPTS --port 8080"

diff --git a/net-proxy/http-replicator/files/http-replicator-3.0.init b/net-proxy/http-replicator/files/http-replicator-3.0.init
deleted file mode 100644
index 7fc3d5e108d..00000000000
--- a/net-proxy/http-replicator/files/http-replicator-3.0.init
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2016 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-depend() {
-	need net
-}
-
-start() {
-	ebegin "Starting Http-Replicator"
-	start-stop-daemon --start --pidfile /var/run/http-replicator.pid --name http-replicator \
-		--exec /usr/bin/http-replicator -- -s -f --pid /var/run/http-replicator.pid --daemon $DAEMON_OPTS
-	eend $? "Failed to start Http-Replicator"
-}
-
-stop() {
-	ebegin "Stopping Http-Replicator"
-	start-stop-daemon --stop --pidfile /var/run/http-replicator.pid --name http-replicator --signal 2
-	eend $? "Failed to stop Http-Replicator"
-}

diff --git a/net-proxy/http-replicator/http-replicator-3.0-r7.ebuild b/net-proxy/http-replicator/http-replicator-3.0-r7.ebuild
deleted file mode 100644
index 68405a1f8c1..00000000000
--- a/net-proxy/http-replicator/http-replicator-3.0-r7.ebuild
+++ /dev/null
@@ -1,93 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-PYTHON_COMPAT=( python2_7 ) # not 2.6 bug #33907, not 3.0 bug #411083
-
-inherit eutils python-single-r1 systemd
-
-MY_P="${PN}_${PV}"
-
-DESCRIPTION="Proxy cache for Gentoo packages"
-HOMEPAGE="https://sourceforge.net/projects/http-replicator"
-SRC_URI="mirror://sourceforge/http-replicator/${MY_P}.tar.gz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~alpha amd64 hppa ppc ~sparc x86"
-REQUIRED_USE="${PYTHON_REQUIRED_USE}"
-
-RDEPEND="${PYTHON_DEPS}"
-DEPEND="${RDEPEND}"
-
-S="${WORKDIR}/${MY_P}"
-
-PATCHES=(
-	"${FILESDIR}/http-replicator-3.0-sighup.patch"
-	"${FILESDIR}/http-replicator-3-unique-cache-name.patch"
-	"${FILESDIR}/http-replicator-3-missing-directory.patch"
-)
-
-pkg_setup() {
-	python-single-r1_pkg_setup
-}
-
-src_install() {
-	# Daemon and repcacheman into /usr/bin
-	python_scriptinto /usr/bin
-	python_doscript http-replicator
-	python_newscript "${FILESDIR}/http-replicator-3.0-repcacheman-0.44-r2" repcacheman.py
-
-	exeinto /usr/bin
-	newexe "${FILESDIR}/http-replicator-3.0-callrepcacheman-0.1" repcacheman
-
-	# init.d scripts
-	newinitd "${FILESDIR}/http-replicator-3.0.init" http-replicator
-	newconfd "${FILESDIR}/http-replicator-3.0.conf" http-replicator
-
-	systemd_dounit "${FILESDIR}"/http-replicator.service
-	systemd_install_serviced "${FILESDIR}"/http-replicator.service.conf
-
-	# Docs
-	dodoc README debian/changelog
-
-	# Man Page - Not Gentooified yet
-	doman http-replicator.1
-
-	insinto /etc/logrotate.d
-	newins debian/logrotate http-replicator
-}
-
-pkg_postinst() {
-	elog
-	ewarn "Before starting http-replicator, please follow the next few steps:"
-	elog "- Modify /etc/conf.d/http-replicator if required."
-	ewarn "- Run /usr/bin/repcacheman to set up the cache."
-	elog "- Add http_proxy=\"http://serveraddress:8080\" to make.conf on"
-	elog "  the server as well as on the client machines."
-	elog "- Make sure FETCHCOMMAND adds the X-unique-cache-name header to"
-	elog "  HTTP requests in make.conf (or maybe portage will add it to"
-	elog "  the default make.globals someday).  Example:"
-	elog '   FETCHCOMMAND="wget -t 3 -T 60 --passive-ftp -O \"\${DISTDIR}/\${FILE}\" --header=\"X-unique-cache-name: \${FILE}\" \"\${URI}\""'
-	elog '   RESUMECOMMAND="wget -c -t 3 -T 60 --passive-ftp -O \"\${DISTDIR}/\${FILE}\" --header=\"X-unique-cache-name: \${FILE}\" \"\${URI}\""'
-	elog "- Arrange to periodically run repcacheman on this server,"
-	elog "  to clean up the local /usr/portage/distfiles directory."
-	elog "- Arrange to periodically run something like the following"
-	elog "  on this server.  'eclean' is in app-portage/gentoolkit."
-	elog "    ( export DISTDIR=/var/cache/http-replicator/"
-	elog "      eclean -i distfiles )"
-	elog "- Even with FETCHCOMMAND fixing most cases, occasionally"
-	elog "  an older invalid version of a file may end up in the cache,"
-	elog "  causing checksum failures when portage tries to fetch"
-	elog "  it.  To recover, either use eclean (above), manually delete"
-	elog "  the relevant file from the cache, or temporarily comment"
-	elog "  out the http_proxy setting.  Commenting only requires"
-	elog "  access to client config, not server cache."
-	elog "- Make sure GENTOO_MIRRORS in /etc/portage/make.conf starts"
-	elog "  with several good http mirrors."
-	elog
-	elog "For more information please refer to the following forum thread:"
-	elog "  http://forums.gentoo.org/viewtopic-t-173226.html"
-	elog
-}


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-02-23  9:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-23  9:43 [gentoo-commits] repo/gentoo:master commit in: net-proxy/http-replicator/, net-proxy/http-replicator/files/ Pacho Ramos
  -- strict thread matches above, loose matches on Subject: below --
2018-11-04 12:34 Pacho Ramos
2016-05-03 19:17 Austin English
2016-03-23 11:00 Sam Jorna

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox