summaryrefslogtreecommitdiff
path: root/net-proxy/http-replicator
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /net-proxy/http-replicator
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.xz
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'net-proxy/http-replicator')
-rw-r--r--net-proxy/http-replicator/Manifest2
-rwxr-xr-xnet-proxy/http-replicator/files/http-replicator-3.0-callrepcacheman-0.13
-rwxr-xr-xnet-proxy/http-replicator/files/http-replicator-3.0-repcacheman-0.44201
-rwxr-xr-xnet-proxy/http-replicator/files/http-replicator-3.0-repcacheman-0.44-r1201
-rwxr-xr-xnet-proxy/http-replicator/files/http-replicator-3.0-repcacheman-0.44-r2201
-rw-r--r--net-proxy/http-replicator/files/http-replicator-3.0-sighup.patch20
-rw-r--r--net-proxy/http-replicator/files/http-replicator-3.0.conf46
-rwxr-xr-xnet-proxy/http-replicator/files/http-replicator-3.0.init21
-rw-r--r--net-proxy/http-replicator/files/http-replicator-4.0_alpha2-r2.conf46
-rw-r--r--net-proxy/http-replicator/files/http-replicator-4.0_alpha2-r3-pid.patch101
-rw-r--r--net-proxy/http-replicator/files/http-replicator-4.0_alpha2-r3.init22
-rw-r--r--net-proxy/http-replicator/files/http-replicator.service11
-rw-r--r--net-proxy/http-replicator/files/http-replicator.service.conf3
-rw-r--r--net-proxy/http-replicator/http-replicator-3.0-r4.ebuild68
-rw-r--r--net-proxy/http-replicator/http-replicator-4.0_alpha2-r4.ebuild69
-rw-r--r--net-proxy/http-replicator/metadata.xml10
16 files changed, 1025 insertions, 0 deletions
diff --git a/net-proxy/http-replicator/Manifest b/net-proxy/http-replicator/Manifest
new file mode 100644
index 00000000000..ff417839c3e
--- /dev/null
+++ b/net-proxy/http-replicator/Manifest
@@ -0,0 +1,2 @@
+DIST http-replicator_3.0.tar.gz 39291 SHA256 cd5b2c8b4b6da4fd5a9313cd5e7d4179805002f2de5fd25a42301df4f5bd161e SHA512 d98a608c38201db6f2d8ba809a4777ab5588f5ed395882bdf542c2788df1770c61a2de160604c09297d847f2c73463ba0530d7f2c2e482467f8e8f35be068d57 WHIRLPOOL 965524243895a6a00df3b4be3bae391bc532f3ccef87383a487c87efbcd858aa1a2d15598be752b7640e57aef47ab7cbaad8430033925935f16a527aa50db36a
+DIST http-replicator_4.0alpha2.tgz 27575 SHA256 43f466b691244104caba96fd16df75978731ea248ad1681beaf88342a708875a SHA512 437e0cc881af0cb8f84bfd1366bb6edeee4f76112c4b2ac2af4bcb8809462852b96e9c99e04c8f370492c9e1eb33ddc68a85c4f09b073694242cd6c05b4d3a6c WHIRLPOOL 599d2ee6bab4ffb4792913763b303da3a473dee2aa15510ceee32d042e54abdb49a902eee3346c4c735c97169e11fcd2340e7c741e160500c4a6bbd064a57561
diff --git a/net-proxy/http-replicator/files/http-replicator-3.0-callrepcacheman-0.1 b/net-proxy/http-replicator/files/http-replicator-3.0-callrepcacheman-0.1
new file mode 100755
index 00000000000..14cd0a70a53
--- /dev/null
+++ b/net-proxy/http-replicator/files/http-replicator-3.0-callrepcacheman-0.1
@@ -0,0 +1,3 @@
+#! /bin/bash
+source /etc/conf.d/http-replicator
+/usr/bin/repcacheman.py $GENERAL_OPTS
diff --git a/net-proxy/http-replicator/files/http-replicator-3.0-repcacheman-0.44 b/net-proxy/http-replicator/files/http-replicator-3.0-repcacheman-0.44
new file mode 100755
index 00000000000..b200a7be48f
--- /dev/null
+++ b/net-proxy/http-replicator/files/http-replicator-3.0-repcacheman-0.44
@@ -0,0 +1,201 @@
+#! /usr/bin/python
+#
+# repcacheman ver 0.44
+#
+# Cache Manager for Http-Replicator
+# deletes duplicate files in PORTDIR.
+# imports authenticated (checksum + listed in portage)
+# files from PORTDIR to replicator's cache directory.
+#
+# Uses portage to perform checksum and database functions.
+# All else, Copyright(C)2004-2007 Tom Poplawski (poplawtm@earthlink.net)
+# Distributed under the terms of the GNU General Public License v2
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+
+import portage_manifest
+import portage_checksum
+import portage_exception
+import portage
+import string
+import os
+import pwd,sys,optparse
+
+if os.getuid():
+ print"Must be root"
+ sys.exit(1)
+
+# Parse Options
+
+parser = optparse.OptionParser()
+parser.add_option('-d', '--dir', type='string', default="/var/cache/http-replicator", help='http-replicators cache DIR')
+parser.add_option('-u','--user', type='string', default="portage", help='http-replicator USER')
+options, args = parser.parse_args() # parse command line
+
+if options.user:
+ try:
+ uid=pwd.getpwnam(options.user)[2]
+ gid=pwd.getpwnam(options.user)[3]
+ except:
+ print "User \'" + options.user + "\' Doesn't exist on system - edit config or add user to system."
+ sys.exit(1)
+else:
+ print "Error\n\tunable to get USER from /etc/http-replicator.conf"
+ sys.exit(1)
+
+# dir is replicator's cache directory
+dir=options.dir+"/"
+
+if os.path.isdir(dir) :
+ newdir=0
+else :
+ print"\n\nBegin Http-Replicator Setup...."
+ try:
+ os.makedirs(dir)
+ print "\tcreated " + dir
+ newdir=1
+ except:
+ print "\tcreate " + dir + " failed"
+ print '\terror:', sys.exc_info()[1]
+ sys.exit(1)
+ try:
+ os.chown(dir,uid,gid)
+ print "\tchanged owner of " + dir + " to " + options.user
+ except:
+ print "\tchange owner " + dir + " to " + options.user + " failed:"
+ print '\terror:', sys.exc_info()[1]
+
+print "\n\nReplicator's cache directory: " + dir
+
+# Import Portage settings
+
+distdir=portage.settings["DISTDIR"]+"/"
+if distdir:
+ print "Portage's DISTDIR: " + distdir
+else:
+ print"Unable to get Portage's DISTDIR"
+ sys.exit(1)
+
+# Start Work
+
+print "\nComparing directories...."
+
+# Create filecmp object
+import filecmp
+dc=filecmp.dircmp (distdir,dir,['cvs-src','git-src','hg-src','.locks'])
+print "Done!"
+
+dupes=dc.common
+deleted=0
+
+if dupes:
+ print "\nDeleting duplicate file(s) in " + distdir
+
+ for s in dupes:
+ print s
+ try:
+ os.remove(distdir + s )
+ deleted +=1
+ except:
+ print "\tdelete " + distdir + s + " failed:"
+ print '\terror:', sys.exc_info()[1]
+
+ print "Done!"
+
+
+newfiles=dc.left_only
+nf=len(dc.left_only)
+
+if nf:
+ print "\nNew files in DISTDIR:"
+ for s in newfiles:
+ print s
+ print"\nChecking authenticity and integrity of new files..."
+ added=0
+ errors=0
+ badsum=0
+
+# search all packages
+
+ for mycp in portage.db["/"]["porttree"].dbapi.cp_all():
+ manifest = portage_manifest.Manifest("/usr/portage/" + mycp , distdir)
+ if manifest == None:
+ portage.writemsg("Missing manifest: %s\n" % mycpv)
+
+ remove=[]
+ for file in newfiles:
+ if manifest.hasFile("DIST",file):
+ try:
+ myok, myreason = manifest.checkFileHashes("DIST",file)
+
+ try:
+ os.rename(distdir+file,dir+file)
+ added += 1
+ except:
+ try:
+ import shutil
+ shutil.copyfile(distdir+file,dir+file)
+ added += 1
+ os.remove(distdir+file)
+ except:
+ print "\tmove/copy " + file + " failed:"
+ print '\terror:', sys.exc_info()[1]
+ errors+=1
+
+ try:
+ os.chown(dir+file,uid,gid)
+ except:
+ print "\tchown " + file + " failed:"
+ print '\terror:', sys.exc_info()[1]
+ errors +=1
+
+ remove.append( file )
+
+ except portage_exception.DigestException, e:
+ print("\n!!! Digest verification failed:")
+ print("!!! %s" % e.value[0])
+ print("!!! Reason: %s" % e.value[1])
+ print("!!! Got: %s" % e.value[2])
+ print("!!! Expected: %s" % e.value[3])
+ badsum+=1
+ if remove:
+ for rf in remove:
+ newfiles.remove ( rf )
+
+
+print "\nSUMMARY:"
+print "Found " + str(len(dupes)) + " duplicate file(s)"
+if deleted:
+ print "\tDeleted " + str(deleted) + " dupe(s)"
+
+if nf:
+ print "Found " + str(nf) + " new file(s)"
+ print "\tAdded " + str(added) + " of those file(s) to the cache"
+
+ print "Rejected " +str(len(newfiles)) + " File(s) - ",
+ print str(badsum) + " failed checksum(s)"
+ for s in newfiles:
+ print "\t%s" %s
+ if errors:
+ print "Encountered " +str(errors) + " errors"
+# if badsum:
+# print str(badsum) + " partial/corrupted file(s)"
+
+if newdir:
+ print"\n\nexecute:\n/etc/init.d/http-replicator start"
+ print"to run http-replicator.\n\nexecute:\nrc-update add http-replicator default"
+ print"to make http-replicator start at boot"
+ print"\n\nexecute:\n/usr/bin/repcacheman\nafter emerge's on the server to delete"
+ print"dup files and add new files to the cache"
+
+print "\n\nHTTP-Replicator requires you delete any partial downloads in " + distdir
+print "run rm -rf " + distdir +'*'
+
diff --git a/net-proxy/http-replicator/files/http-replicator-3.0-repcacheman-0.44-r1 b/net-proxy/http-replicator/files/http-replicator-3.0-repcacheman-0.44-r1
new file mode 100755
index 00000000000..9f0069bc7eb
--- /dev/null
+++ b/net-proxy/http-replicator/files/http-replicator-3.0-repcacheman-0.44-r1
@@ -0,0 +1,201 @@
+#! /usr/bin/python
+#
+# repcacheman ver 0.44
+#
+# Cache Manager for Http-Replicator
+# deletes duplicate files in PORTDIR.
+# imports authenticated (checksum + listed in portage)
+# files from PORTDIR to replicator's cache directory.
+#
+# Uses portage to perform checksum and database functions.
+# All else, Copyright(C)2004-2007 Tom Poplawski (poplawtm@earthlink.net)
+# Distributed under the terms of the GNU General Public License v2
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+
+import portage.manifest
+import portage.checksum
+import portage.exception
+import portage
+import string
+import os
+import pwd,sys,optparse
+
+if os.getuid():
+ print"Must be root"
+ sys.exit(1)
+
+# Parse Options
+
+parser = optparse.OptionParser()
+parser.add_option('-d', '--dir', type='string', default="/var/cache/http-replicator", help='http-replicators cache DIR')
+parser.add_option('-u','--user', type='string', default="portage", help='http-replicator USER')
+options, args = parser.parse_args() # parse command line
+
+if options.user:
+ try:
+ uid=pwd.getpwnam(options.user)[2]
+ gid=pwd.getpwnam(options.user)[3]
+ except:
+ print "User \'" + options.user + "\' Doesn't exist on system - edit config or add user to system."
+ sys.exit(1)
+else:
+ print "Error\n\tunable to get USER from /etc/http-replicator.conf"
+ sys.exit(1)
+
+# dir is replicator's cache directory
+dir=options.dir+"/"
+
+if os.path.isdir(dir) :
+ newdir=0
+else :
+ print"\n\nBegin Http-Replicator Setup...."
+ try:
+ os.makedirs(dir)
+ print "\tcreated " + dir
+ newdir=1
+ except:
+ print "\tcreate " + dir + " failed"
+ print '\terror:', sys.exc_info()[1]
+ sys.exit(1)
+ try:
+ os.chown(dir,uid,gid)
+ print "\tchanged owner of " + dir + " to " + options.user
+ except:
+ print "\tchange owner " + dir + " to " + options.user + " failed:"
+ print '\terror:', sys.exc_info()[1]
+
+print "\n\nReplicator's cache directory: " + dir
+
+# Import Portage settings
+
+distdir=portage.settings["DISTDIR"]+"/"
+if distdir:
+ print "Portage's DISTDIR: " + distdir
+else:
+ print"Unable to get Portage's DISTDIR"
+ sys.exit(1)
+
+# Start Work
+
+print "\nComparing directories...."
+
+# Create filecmp object
+import filecmp
+dc=filecmp.dircmp (distdir,dir,['cvs-src','git-src','hg-src','.locks'])
+print "Done!"
+
+dupes=dc.common
+deleted=0
+
+if dupes:
+ print "\nDeleting duplicate file(s) in " + distdir
+
+ for s in dupes:
+ print s
+ try:
+ os.remove(distdir + s )
+ deleted +=1
+ except:
+ print "\tdelete " + distdir + s + " failed:"
+ print '\terror:', sys.exc_info()[1]
+
+ print "Done!"
+
+
+newfiles=dc.left_only
+nf=len(dc.left_only)
+
+if nf:
+ print "\nNew files in DISTDIR:"
+ for s in newfiles:
+ print s
+ print"\nChecking authenticity and integrity of new files..."
+ added=0
+ errors=0
+ badsum=0
+
+# search all packages
+
+ for mycp in portage.db["/"]["porttree"].dbapi.cp_all():
+ manifest = portage.manifest.Manifest("/usr/portage/" + mycp , distdir)
+ if manifest == None:
+ portage.writemsg("Missing manifest: %s\n" % mycpv)
+
+ remove=[]
+ for file in newfiles:
+ if manifest.hasFile("DIST",file):
+ try:
+ myok, myreason = manifest.checkFileHashes("DIST",file)
+
+ try:
+ os.rename(distdir+file,dir+file)
+ added += 1
+ except:
+ try:
+ import shutil
+ shutil.copyfile(distdir+file,dir+file)
+ added += 1
+ os.remove(distdir+file)
+ except:
+ print "\tmove/copy " + file + " failed:"
+ print '\terror:', sys.exc_info()[1]
+ errors+=1
+
+ try:
+ os.chown(dir+file,uid,gid)
+ except:
+ print "\tchown " + file + " failed:"
+ print '\terror:', sys.exc_info()[1]
+ errors +=1
+
+ remove.append( file )
+
+ except portage.exception.DigestException, e:
+ print("\n!!! Digest verification failed:")
+ print("!!! %s" % e.value[0])
+ print("!!! Reason: %s" % e.value[1])
+ print("!!! Got: %s" % e.value[2])
+ print("!!! Expected: %s" % e.value[3])
+ badsum+=1
+ if remove:
+ for rf in remove:
+ newfiles.remove ( rf )
+
+
+print "\nSUMMARY:"
+print "Found " + str(len(dupes)) + " duplicate file(s)"
+if deleted:
+ print "\tDeleted " + str(deleted) + " dupe(s)"
+
+if nf:
+ print "Found " + str(nf) + " new file(s)"
+ print "\tAdded " + str(added) + " of those file(s) to the cache"
+
+ print "Rejected " +str(len(newfiles)) + " File(s) - ",
+ print str(badsum) + " failed checksum(s)"
+ for s in newfiles:
+ print "\t%s" %s
+ if errors:
+ print "Encountered " +str(errors) + " errors"
+# if badsum:
+# print str(badsum) + " partial/corrupted file(s)"
+
+if newdir:
+ print"\n\nexecute:\n/etc/init.d/http-replicator start"
+ print"to run http-replicator.\n\nexecute:\nrc-update add http-replicator default"
+ print"to make http-replicator start at boot"
+ print"\n\nexecute:\n/usr/bin/repcacheman\nafter emerge's on the server to delete"
+ print"dup files and add new files to the cache"
+
+print "\n\nHTTP-Replicator requires you delete any partial downloads in " + distdir
+print "run rm -rf " + distdir +'*'
+
diff --git a/net-proxy/http-replicator/files/http-replicator-3.0-repcacheman-0.44-r2 b/net-proxy/http-replicator/files/http-replicator-3.0-repcacheman-0.44-r2
new file mode 100755
index 00000000000..35d0a9e39fa
--- /dev/null
+++ b/net-proxy/http-replicator/files/http-replicator-3.0-repcacheman-0.44-r2
@@ -0,0 +1,201 @@
+#! /usr/bin/python
+#
+# repcacheman ver 0.44
+#
+# Cache Manager for Http-Replicator
+# deletes duplicate files in PORTDIR.
+# imports authenticated (checksum + listed in portage)
+# files from PORTDIR to replicator's cache directory.
+#
+# Uses portage to perform checksum and database functions.
+# All else, Copyright(C)2004-2007 Tom Poplawski (poplawtm@earthlink.net)
+# Distributed under the terms of the GNU General Public License v2
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+
+import portage.manifest
+import portage.checksum
+import portage.exception
+import portage
+import string
+import os
+import pwd,sys,optparse
+
+if os.getuid():
+ print"Must be root"
+ sys.exit(1)
+
+# Parse Options
+
+parser = optparse.OptionParser()
+parser.add_option('-d', '--dir', type='string', default="/var/cache/http-replicator", help='http-replicators cache DIR')
+parser.add_option('-u','--user', type='string', default="portage", help='http-replicator USER')
+options, args = parser.parse_args() # parse command line
+
+if options.user:
+ try:
+ uid=pwd.getpwnam(options.user)[2]
+ gid=pwd.getpwnam(options.user)[3]
+ except:
+ print "User \'" + options.user + "\' Doesn't exist on system - edit config or add user to system."
+ sys.exit(1)
+else:
+ print "Error\n\tunable to get USER from /etc/http-replicator.conf"
+ sys.exit(1)
+
+# dir is replicator's cache directory
+dir=options.dir+"/"
+
+if os.path.isdir(dir) :
+ newdir=0
+else :
+ print"\n\nBegin Http-Replicator Setup...."
+ try:
+ os.makedirs(dir)
+ print "\tcreated " + dir
+ newdir=1
+ except:
+ print "\tcreate " + dir + " failed"
+ print '\terror:', sys.exc_info()[1]
+ sys.exit(1)
+ try:
+ os.chown(dir,uid,gid)
+ print "\tchanged owner of " + dir + " to " + options.user
+ except:
+ print "\tchange owner " + dir + " to " + options.user + " failed:"
+ print '\terror:', sys.exc_info()[1]
+
+print "\n\nReplicator's cache directory: " + dir
+
+# Import Portage settings
+
+distdir=portage.settings["DISTDIR"]+"/"
+if distdir:
+ print "Portage's DISTDIR: " + distdir
+else:
+ print"Unable to get Portage's DISTDIR"
+ sys.exit(1)
+
+# Start Work
+
+print "\nComparing directories...."
+
+# Create filecmp object
+import filecmp
+dc=filecmp.dircmp (distdir,dir,['cvs-src','git-src','hg-src','egit-src','.locks'])
+print "Done!"
+
+dupes=dc.common
+deleted=0
+
+if dupes:
+ print "\nDeleting duplicate file(s) in " + distdir
+
+ for s in dupes:
+ print s
+ try:
+ os.remove(distdir + s )
+ deleted +=1
+ except:
+ print "\tdelete " + distdir + s + " failed:"
+ print '\terror:', sys.exc_info()[1]
+
+ print "Done!"
+
+
+newfiles=dc.left_only
+nf=len(dc.left_only)
+
+if nf:
+ print "\nNew files in DISTDIR:"
+ for s in newfiles:
+ print s
+ print"\nChecking authenticity and integrity of new files..."
+ added=0
+ errors=0
+ badsum=0
+
+# search all packages
+
+ for mycp in portage.db["/"]["porttree"].dbapi.cp_all():
+ manifest = portage.manifest.Manifest("/usr/portage/" + mycp , distdir)
+ if manifest == None:
+ portage.writemsg("Missing manifest: %s\n" % mycpv)
+
+ remove=[]
+ for file in newfiles:
+ if manifest.hasFile("DIST",file):
+ try:
+ myok, myreason = manifest.checkFileHashes("DIST",file)
+
+ try:
+ os.rename(distdir+file,dir+file)
+ added += 1
+ except:
+ try:
+ import shutil
+ shutil.copyfile(distdir+file,dir+file)
+ added += 1
+ os.remove(distdir+file)
+ except:
+ print "\tmove/copy " + file + " failed:"
+ print '\terror:', sys.exc_info()[1]
+ errors+=1
+
+ try:
+ os.chown(dir+file,uid,gid)
+ except:
+ print "\tchown " + file + " failed:"
+ print '\terror:', sys.exc_info()[1]
+ errors +=1
+
+ remove.append( file )
+
+ except portage.exception.DigestException, e:
+ print("\n!!! Digest verification failed:")
+ print("!!! %s" % e.value[0])
+ print("!!! Reason: %s" % e.value[1])
+ print("!!! Got: %s" % e.value[2])
+ print("!!! Expected: %s" % e.value[3])
+ badsum+=1
+ if remove:
+ for rf in remove:
+ newfiles.remove ( rf )
+
+
+print "\nSUMMARY:"
+print "Found " + str(len(dupes)) + " duplicate file(s)"
+if deleted:
+ print "\tDeleted " + str(deleted) + " dupe(s)"
+
+if nf:
+ print "Found " + str(nf) + " new file(s)"
+ print "\tAdded " + str(added) + " of those file(s) to the cache"
+
+ print "Rejected " +str(len(newfiles)) + " File(s) - ",
+ print str(badsum) + " failed checksum(s)"
+ for s in newfiles:
+ print "\t%s" %s
+ if errors:
+ print "Encountered " +str(errors) + " errors"
+# if badsum:
+# print str(badsum) + " partial/corrupted file(s)"
+
+if newdir:
+ print"\n\nexecute:\n/etc/init.d/http-replicator start"
+ print"to run http-replicator.\n\nexecute:\nrc-update add http-replicator default"
+ print"to make http-replicator start at boot"
+ print"\n\nexecute:\n/usr/bin/repcacheman\nafter emerge's on the server to delete"
+ print"dup files and add new files to the cache"
+
+print "\n\nHTTP-Replicator requires you delete any partial downloads in " + distdir
+print "run rm -f " + distdir +'*'
+
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
new file mode 100644
index 00000000000..969bbc91f9d
--- /dev/null
+++ b/net-proxy/http-replicator/files/http-replicator-3.0-sighup.patch
@@ -0,0 +1,20 @@
+--- 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
new file mode 100644
index 00000000000..35671fd262c
--- /dev/null
+++ b/net-proxy/http-replicator/files/http-replicator-3.0.conf
@@ -0,0 +1,46 @@
+## 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
new file mode 100755
index 00000000000..85f773ed733
--- /dev/null
+++ b/net-proxy/http-replicator/files/http-replicator-3.0.init
@@ -0,0 +1,21 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+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/files/http-replicator-4.0_alpha2-r2.conf b/net-proxy/http-replicator/files/http-replicator-4.0_alpha2-r2.conf
new file mode 100644
index 00000000000..cea7c9632a3
--- /dev/null
+++ b/net-proxy/http-replicator/files/http-replicator-4.0_alpha2-r2.conf
@@ -0,0 +1,46 @@
+## Configuration file for HTTP Replicator automatically sourced by init script.
+
+#################
+## REPCACHEMAN ##
+#################
+
+## 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"
+
+#####################
+## HTTP-REPLICATOR ##
+#####################
+
+## Specify which file to log too, use /dev/null to disable.
+LOG_FILE="/var/log/http-replicator.log"
+
+# Set cache root directory.
+DAEMON_OPTS="--root /var/cache/http-replicator/"
+
+## Try IPv6 addresses if available.
+# DAEMON_OPTS="$DAEMON_OPTS --ipv6"
+
+## The proxy port on which the server listens for http requests, default 8080.
+# DAEMON_OPTS="$DAEMON_OPTS --port 8080"
+
+## Break connection after so many seconds of inactivity, default 15.
+# DAEMON_OPTS="$DAEMON_OPTS --timeout 15"
+
+## Limit download rate at a fixed K/s.
+# DAEMON_OPTS="$DAEMON_OPTS --limit RATE"
+
+## Do you need the proxy to work offline, never connecting to a server?
+# DAEMON_OPTS="$DAEMON_OPTS --offline"
+
+## Show http headers and other info in log messages.
+# DAEMON_OPTS="$DAEMON_OPTS --verbose"
+
+## Switch from gather to debug output module.
+# DAEMON_OPTS="$DAEMON_OPTS --debug"
+
+## More options (eg --flat and --static) are listed in `http-replicator --help`,
+## the --daemon parameter is automatically passed by the init script. \ No newline at end of file
diff --git a/net-proxy/http-replicator/files/http-replicator-4.0_alpha2-r3-pid.patch b/net-proxy/http-replicator/files/http-replicator-4.0_alpha2-r3-pid.patch
new file mode 100644
index 00000000000..a1cf5eddbfc
--- /dev/null
+++ b/net-proxy/http-replicator/files/http-replicator-4.0_alpha2-r3-pid.patch
@@ -0,0 +1,101 @@
+Bring back the --pid functionality of 3.x, needed for our init script.
+
+Patch contributed by Nikita Kozlov (klnikita / klnikita_ on IRC).
+
+Slight adjustments made to use --pid instead of --pidfile and reordered --help.
+
+URL: https://dpaste.org/Menvq/
+BUG: https://bugs.gentoo.org/show_bug.cgi?id=472422
+
+--- a/fiber.py
++++ b/fiber.py
+@@ -136,11 +136,13 @@
+ self.__stdout.flush()
+ self.__newline = string.endswith( '\n' )
+
+
+-def fork( output ):
++def fork( output, pidfile ):
+
+ try:
++ if pidfile:
++ pidout = open(pidfile, 'w') # open pid file for writing
+ log = open( output, 'w' )
+ nul = open( '/dev/null', 'r' )
+ pid = os.fork()
+ except IOError, e:
+@@ -166,17 +168,20 @@
+ print 'error:', e
+ sys.exit( 1 )
+
+ if pid:
++ if pidfile:
++ pidout.write(str(pid))
++ pidout.close()
+ print pid
+ sys.exit( 0 )
+
+ os.dup2( log.fileno(), sys.stdout.fileno() )
+ os.dup2( log.fileno(), sys.stderr.fileno() )
+ os.dup2( nul.fileno(), sys.stdin.fileno() )
+
+
+-def spawn( generator, port, debug, log ):
++def spawn( generator, port, debug, log, pidfile ):
+
+ try:
+ listener = socket.socket( socket.AF_INET, socket.SOCK_STREAM )
+ listener.setblocking( 0 )
+@@ -187,9 +192,9 @@
+ print 'error: failed to create socket:', e
+ sys.exit( 1 )
+
+ if log:
+- fork( log )
++ fork( log, pidfile )
+
+ if debug:
+ myFiber = DebugFiber
+ else:
+--- a/http-replicator
++++ b/http-replicator
+@@ -59,5 +59,5 @@
+
+ print 'Transaction successfully completed'
+
+
+-fiber.spawn( Replicator, Params.PORT, Params.DEBUG, Params.LOG )
++fiber.spawn( Replicator, Params.PORT, Params.DEBUG, Params.LOG, Params.PIDFILE )
+--- a/Params.py
++++ b/Params.py
+@@ -6,8 +6,9 @@
+ PORT = 8080
+ ROOT = os.getcwd() + os.sep
+ VERBOSE = 0
+ TIMEOUT = 15
++PIDFILE = False
+ FAMILY = socket.AF_INET
+ FLAT = False
+ STATIC = False
+ ONLINE = True
+@@ -21,8 +22,9 @@
+
+ options:
++ --pid FILE write process ID to FILE
+ -h --help show this help message and exit
+ -p --port PORT listen on this port for incoming connections, default %(PORT)i
+ -r --root DIR set cache root directory, default current: %(ROOT)s
+ -v --verbose show http headers and other info
+ -t --timeout SEC break connection after so many seconds of inactivity, default %(TIMEOUT)i
+ -6 --ipv6 try ipv6 addresses if available
+@@ -74,8 +76,10 @@
+ except:
+ sys.exit( 'Error: %s requires a numerical argument' % _arg )
+ elif _arg == '--daemon':
+ LOG = _args.next()
++ elif _arg == '--pid':
++ PIDFILE = _args.next()
+ elif _arg == '--debug':
+ DEBUG = True
+ else:
+ sys.exit( 'Error: invalid option %r' % _arg ) \ No newline at end of file
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
new file mode 100644
index 00000000000..b1eae998553
--- /dev/null
+++ b/net-proxy/http-replicator/files/http-replicator-4.0_alpha2-r3.init
@@ -0,0 +1,22 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+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 -- --static \
+ --flat --daemon $LOG_FILE $DAEMON_OPTS --pid /var/run/http-replicator.pid
+ 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/files/http-replicator.service b/net-proxy/http-replicator/files/http-replicator.service
new file mode 100644
index 00000000000..6a2a7e5f5df
--- /dev/null
+++ b/net-proxy/http-replicator/files/http-replicator.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=http-replicator daemon
+After=network.target
+
+[Service]
+ExecStart=/usr/bin/http-replicator -s -f \
+ --dir /var/cache/http-replicator --user portage --log /var/log/http-replicator.log \
+ $DAEMON_OPTS
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-proxy/http-replicator/files/http-replicator.service.conf b/net-proxy/http-replicator/files/http-replicator.service.conf
new file mode 100644
index 00000000000..da7445d080c
--- /dev/null
+++ b/net-proxy/http-replicator/files/http-replicator.service.conf
@@ -0,0 +1,3 @@
+# Set various parameters for http-replicator
+[Service]
+Environment="DAEMON_OPTS= --alias /usr/portage/packages:packages --ip 192.168.*.* --ip 10.*.*.* --port 8080"
diff --git a/net-proxy/http-replicator/http-replicator-3.0-r4.ebuild b/net-proxy/http-replicator/http-replicator-3.0-r4.ebuild
new file mode 100644
index 00000000000..63e46c55528
--- /dev/null
+++ b/net-proxy/http-replicator/http-replicator-3.0-r4.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+PYTHON_DEPEND="2:2.7:2.7" # not 2.6 bug #33907, not 3.0 bug #411083
+inherit eutils python 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"
+IUSE=""
+
+DEPEND=""
+RDEPEND="${DEPEND}"
+
+src_compile() {
+ epatch "${FILESDIR}/http-replicator-3.0-sighup.patch"
+ einfo "No compilation necessary"
+}
+
+src_install(){
+ # Daemon and repcacheman into /usr/bin
+ dobin http-replicator
+ newexe "${FILESDIR}/http-replicator-3.0-callrepcacheman-0.1" repcacheman
+ newexe "${FILESDIR}/http-replicator-3.0-repcacheman-0.44-r2" repcacheman.py
+
+ # 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
+
+ # not 2.6 bug #33907, not 3.0 bug #411083
+ python_convert_shebangs -r 2.7 "${ED}"
+
+ # 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() {
+ einfo
+ einfo "Before starting http-replicator, please follow the next few steps:"
+ einfo "- modify /etc/conf.d/http-replicator if required"
+ einfo "- run /usr/bin/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/make.conf starts with several"
+ einfo " good http mirrors"
+ einfo
+ einfo "For more information please refer to the following forum thread:"
+ einfo " http://forums.gentoo.org/viewtopic-t-173226.html"
+ einfo
+}
diff --git a/net-proxy/http-replicator/http-replicator-4.0_alpha2-r4.ebuild b/net-proxy/http-replicator/http-replicator-4.0_alpha2-r4.ebuild
new file mode 100644
index 00000000000..02b37992e86
--- /dev/null
+++ b/net-proxy/http-replicator/http-replicator-4.0_alpha2-r4.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2015 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 " http://forums.gentoo.org/viewtopic-t-173226.html"
+ einfo
+ einfo "Starting with 4.x releases, the conf.d parameters have changed."
+ echo
+}
diff --git a/net-proxy/http-replicator/metadata.xml b/net-proxy/http-replicator/metadata.xml
new file mode 100644
index 00000000000..c5d9e246c46
--- /dev/null
+++ b/net-proxy/http-replicator/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>maintainer-needed@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">http-replicator</remote-id>
+ </upstream>
+</pkgmetadata>