
===============================================
minitage.recipe:fetch
===============================================


Abstract
-----------------
    - This recipe can be used to fetch something from somewhere to some location of your local fileystem
      This something can be either an url or a set of urls.
    - Thus by:

        * git
        * svn
        * ftp, http, file:// (urllib)
        * bazaar
        * mercurial

Specific options
-----------------

* urls
  See the shared options for more information on how to set them.

Detailled documentation
-------------------------
The divide url function test::

    - If you dont precise the directory, its the basename of the url::

        >>> divide_url ('http://foo/bar|svn|666||--ignore-externals')
        ('http://foo/bar', 'svn', '666', 'http.foo.bar', '--ignore-externals')

    - Static as a default::

        >>> divide_url ('')
        ('', 'static', '', '', '')

    - arguements can be optionnal::

        >>> divide_url ('http://foo/bar')
        ('http://foo/bar', 'static', '', 'http.foo.bar', '')


Let's create a buildout configuration file::

    >>> rmdir(tempdir)
    >>> mkdir(tempdir)
    >>> cd(tempdir)
    >>> a = [mkdir(d) for d in ('eggs', 'develop-eggs', 'bin', 'src')]
    >>> install_develop_eggs(['minitage.recipe'])
    >>> install_eggs_from_pathes(['zc.buildout'], sys.path)
    >>> touch('buildout.cfg')
    >>> sh('buildout -o bootstrap')
    buildout -o bootstrap...


Initializing test env.

    >>> if not os.path.exists('foo'):
    ...     mkdir('foo')
    ... else:
    ...     rmdir(foo)
    ...     mkdir('foo')
    >>> touch('foo/configure', data ="""echo configure $@\n""")
    >>> sh('chmod +x foo/configure')
    c...
    >>> touch('foo/Makefile',
    ... data = """
    ... all:
    ... \t@echo all
    ...
    ... install:
    ... \t@echo install
    ...
    ... """)
    >>> sh('tar cfz  foo.tgz foo')
    tar cfz  ...
    <BLANKLINE>


Downloading some urls, files, git checkouts with one in a particular checkout directory and a particular revision::

    >>> data = """
    ... [buildout]
    ... download-cache=${buildout:directory}
    ... parts =
    ...     part
    ... [part]
    ... recipe=minitage.recipe:fetch
    ... urls =file://${buildout:directory}/foo.tgz
    ...        http://git.minitage.org/git/minitage/eggs/minitage.core|git
    ...        http://git.minitage.org/git/minitage/eggs/minitage.recipe|git|e1f30b9d7a89572fa87fe26f8e353304532a281c|minitage.recipe.alt
    ... """
    >>> touch('buildout.cfg', data=data)
    >>> sh('bin/buildout install part')
    bin/buildout  install part...
    minitage.recipe: Start checkouts
    minitage.recipe: Download archive
    minitage.recipe: Downloading file:///tmp/buildout.test/foo.tgz in /tmp/buildout.test/parts/part/foo.tgz
    minitage.recipe: Completed dowbload of file:///tmp/buildout.test/foo.tgz in /tmp/buildout.test/parts/part/
    minitage.recipe: Download archive
    minitage.recipe: Setting path
    Initialized empty Git repository in /tmp/buildout.test/parts/part/minitage.recipe.alt/.git/
    HEAD is now at e1f30b9 0.28
    minitage.recipe: Completed dowbload of http://git.minitage.org/git/minitage/eggs/minitage.recipe in /tmp/buildout.test/parts/part/minitage.recipe.alt
    minitage.recipe: Download archive
    minitage.recipe: Setting path
    Initialized empty Git repository in /tmp/buildout.test/parts/part/http.git.minitage.org.git.minitage.eggs.minitage.core/.git/
    HEAD is now at e6effd1 temporary commit for sharing code
    minitage.recipe: Completed dowbload of http://git.minitage.org/git/minitage/eggs/minitage.core in /tmp/buildout.test/parts/part/http.git.minitage.org.git.minitage.eggs.minitage.core
    minitage.recipe: Finnished checkouts...
    <BLANKLINE>


