从debian apt存储库镜像pypi风格的egg存储库
van.reposync的Python项目详细描述
从debian apt存储库镜像pypi风格的egg存储库
免责声明
此包依赖于尚未发布的python apt(0.8)版本 似乎唯一的下载位置是Debian的实验 分配。目前的版本是0.7.91。
虽然这段代码是为简单的情况测试的,但是有很多不同的失败 模式尚未测试。因此,如果它为你打破,请加上你的失败 自动测试并提交补丁!
使用
doctest设置(以便我们可以测试文档):
>>> import tempfile, os >>> tmp_dir = tempfile.mkdtemp()>>> from van.reposync import tests >>> tests_dir = os.path.dirname(tests.__file__) >>> sources1_list = os.path.join(tmp_dir, 'sources1.list') >>> open(sources1_list, 'w').write(open(os.path.join(tests_dir, 'sources1.list'), 'r').read() % {'tests_dir': tests_dir})
我们提供一个二进制的van reposync,它可以运行来执行 同步。第一次运行时,它需要一个-apt源 指向包含apt存储库的apt sources.list文件的参数 你想照镜子。.list文件必须包含匹配的deb 和deb src行(镜像需要二进制和源包):
>>> tests.runit('van-reposync sync --root %s --apt-sources %s' % (tmp_dir, sources1_list))
完成后,您将看到工具指向的目录 包含apt配置、构建配置和tarballs链接到 一个pypi风格的存储库。
下一次运行不需要apt sources命令,应该快得多:
>>> tests.runit('van-reposync sync --root %s' % tmp_dir)
拆卸
>>> import shutil >>> shutil.rmtree(tmp_dir)
变化
1.0.1(2009-06-15)
- 修复构建版本文件语法。
- 使用非常简单的pypi存储库布局。所有的柏油球都在一个目录里。
1.0.0(2009-06-15)
- 初次发布。