|
发表于 2009-10-29 17:48:31
|
显示全部楼层
Post by MeaCulpa_;2039850
迅雷本身也是提供上传的。当然用电驴更好,如果能用p2p来host一些软件包,也是功德一件。尤其是Gentoo这样充分利用上游软件包的Linux.
不能封之,不如从之!我一般这样下包包:
- #!/bin/sh
- emerge -upfDN world | egrep "[ht|f]tp:\/\/" | tr " " "\t" | sed "/^$/d" > world_fetch_url.txt
- aria2c -i world_fetch_url.txt
复制代码
把其中生成的txt文件导入迅雷即可。
众淫拾柴火焰高,P2P hosting不失为一件好事。
另见: http://maximameaculpa.com/doku.p ... %87%E7%BA%A7portage
自己写的一个简单的python脚本,用于download包(有段时间下载有问题):
- #! /usr/bin/env python
- """
- Process which files gentoo emerge system need to download.
- The download output file could be generated something like:
- emerge -uvDNf world > downloads.txt 2>&1
- Then you could use this small util to get a files list of
- which files need to be downloaded.
- """
- import sys
- import re
- def getDownloadList(file):
- L = []
- M = []
- N = []
- tmp = []
- for line in open(file, 'rt').readlines():
- if(re.match('^>>> Downloading', line)):
- # get the right most string
- L.append(line.split()[-1])
- M = [ x.lstrip("'").rstrip("'") for x in L ]
- # there multiple files from different mirros, we only need to chose
- # one of them.
- for item in M:
- # get the file name.
- x = item.split('/')[-1]
- if not x in tmp:
- tmp.append(x)
- N.append(item)
- # now N should only contain unique file list to be download.
- for item in N:
- print item
- def main(argc, argv):
- if argc != 2:
- print 'usage: %s <file.txt>'
- sys.exit()
- getDownloadList(argv[1])
- argc = len(sys.argv)
- argv = sys.argv
- main(argc, argv)
复制代码 |
|