[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: partial mirroring



> I wrote a small Python script to create a partial Debian mirror.

It looks very nice.  apt-move just always seems to fallback to
the current machine's selections, and none of the alternatives in the
subsequent thread seem to work for me.
 
> It'd be happy about feedback,

I haven't found a later version, but I'm using this simple patch:

--- debmirror.py.orig	Wed May 22 02:28:17 2002
+++ debmirror.py	Wed May 22 02:31:17 2002
@@ -1,7 +1,8 @@
 #!/usr/bin/env python
 
-list = '/mirrors/debian/spool/packages'
-base = '/mirrors/debian'
+cache = '/var/cache/apt/archives'
+list = '/var/mirrors/debian/spool/packages'
+base = '/var/mirrors/debian'
 
 host = 'ftp.de.debian.org'
 sources = {
@@ -123,6 +124,11 @@ def downloadPackage(pkg):
 	global base
 	dest = os.path.join(base, pkg.filename)
 	if not os.path.exists(dest) or pkg.md5sum != md5sum(dest):
+		cachename = os.path.join (cache, 
+		                          os.path.split (pkg.filename)[1])
+		if os.path.exists (cachename):
+			print '	copy from cache %s' % cachename
+			os.system ('ln -f %s %s' % (cachename, dest))
 		print '	downloading %s' % pkg.filename
 		download(pkg.location[0], os.path.join(pkg.location[1], pkg.filename), dest)
 	else:


Jan.

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond - The music typesetter
http://www.xs4all.nl/~jantien       | http://www.lilypond.org


-- 
To UNSUBSCRIBE, email to debian-devel-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: