Skip to main content

ZC buildout recipe to checkout a dir from a svn repository and archive it in a folder

Project description

This product is used to download packages from svn and tar them in a directory.

We need some buildout vars:

>>> data_dir = join(test_dir, 'data')
>>> parts_dir = join(data_dir, 'parts')
>>> buildout = {'instance': {'location': test_dir},
...             'buildout': {'directory': test_dir,
...             'install-from-cache': False,
...             'download-cache':False,
...             'parts-directory': parts_dir}}
>>> name = 'svn-packages'

The recipe will checkout the package from his repository and put it in the section. For testing, we need a local repository:

>>> repository = join(test_dir, 'test_repos')
>>> if isdir(repository): rmtree(repository)
>>> copytree(join(test_dir, 'repos'), repository)

Then, the recipe should work:

>>> options = {
...   'urls':'file:///%s/my_package/trunk my_package' % repository}
>>> from iw.recipe.subversion import Recipe
>>> recipe = Recipe(buildout, name, options)
>>> os.path.join(parts_dir, 'svn-packages') == recipe.install()
True

Ok, we got it:

>>> ls(parts_dir, 'svn-packages')
my_package

If a download-cache directory is given, then an archive is created in the specified path:

>>> archives = join(data_dir, 'archives')
>>> buildout['buildout']['download-cache'] = archives
>>> recipe = Recipe(buildout, name, options)

>>> if isdir(archives): rmtree(archives)

>>> files = recipe.install()

>>> ls(archives)
my_package-r2.tar.gz

Ok, now we can work offline. The package will be installed from the archives directory:

>>> rmtree(repository)
>>> rmtree(parts_dir)
>>> buildout['buildout']['install-from-cache'] = 'true'
>>> buildout['buildout']['download-cache'] = archives
>>> recipe = Recipe(buildout, name, options)
>>> files = recipe.install()

>>> ls(parts_dir, 'svn-packages')
my_package

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

iw.recipe.subversion-0.1dev_r6513-py2.4.egg (29.0 kB view details)

Uploaded Source

File details

Details for the file iw.recipe.subversion-0.1dev_r6513-py2.4.egg.

File metadata

File hashes

Hashes for iw.recipe.subversion-0.1dev_r6513-py2.4.egg
Algorithm Hash digest
SHA256 18f3a43324e3614a6519ad0d09b9d1cdcaae0bb6b69dcc4202a4ee32bdaff597
MD5 8871248fe6f6ae4bf26880cf58ea692d
BLAKE2b-256 f4cf598b3d05313ac7a6bdcdd4e4ffcb6bc63f39b7fa06dda068979d412b11e1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page