Add location to Buildout 'options' dict

parent 81550e03
Changes Changes
======= =======
0.11.2 (Unreleased) 0.11.2 (2012-09-05)
------------------- -------------------
* No change yet. * Add location to Buildout "options" dict, so that it is exposed to other
Buildout parts. [Cedric de Saint Martin]
0.11.1 (2012-09-05) 0.11.1 (2012-09-05)
------------------- -------------------
......
from setuptools import setup, find_packages from setuptools import setup, find_packages
version = '0.11.2-dev' version = '0.11.2'
name = 'slapos.recipe.build' name = 'slapos.recipe.build'
long_description = open("README.rst").read() + "\n" + \ long_description = open("README.rst").read() + "\n" + \
open("CHANGES.txt").read() + "\n" open("CHANGES.txt").read() + "\n"
......
...@@ -123,13 +123,14 @@ class Recipe(object): ...@@ -123,13 +123,14 @@ class Recipe(object):
"""Clone a git repository.""" """Clone a git repository."""
def __init__(self, buildout, name, options): def __init__(self, buildout, name, options):
options.setdefault('location',
os.path.join(buildout['buildout']['parts-directory'], name))
self.repository = options.get('repository') self.repository = options.get('repository')
self.branch = options.get('branch', GIT_DEFAULT_BRANCH_NAME) self.branch = options.get('branch', GIT_DEFAULT_BRANCH_NAME)
self.revision = options.get('revision') self.revision = options.get('revision')
self.git_command = options.get('git-executable', 'git') self.git_command = options.get('git-executable', 'git')
self.name = name self.name = name
self.location = options.get('location', self.location = options.get('location')
os.path.join(buildout['buildout']['parts-directory'], name))
# Set boolean values # Set boolean values
for key in ['develop', 'forbid-download-cache']: for key in ['develop', 'forbid-download-cache']:
attribute = key.replace('-', '_') attribute = key.replace('-', '_')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment