Commit 77f47de0 authored by Léo-Paul Géneau's avatar Léo-Paul Géneau 👾

handle buildout `allow-picked-version` value

If deployment mode option is not provided, default
value is `not allow-picked-version`.
parent 9848fbae
......@@ -46,7 +46,7 @@ ruby-executable
deployment
If set to ``true``, the version of each gem dependency must be provided in
``gems`` option. Default value is ``false``.
``gems`` option. Default value is ``not allow-picked-versions``.
gem-options
Extra options, that will be passed to gem executable. Example::
......
......@@ -13,11 +13,13 @@ import zc.buildout
import six.moves.urllib as urllib
from distutils.util import strtobool
from slapos.recipe.downloadunpacked import Recipe as Download
from zc.buildout.easy_install import allow_picked_versions
strip = lambda x:x.strip() # noqa
is_true = ('false', 'true').index
class Recipe(object):
"""zc.buildout recipe for compiling and installing software"""
......@@ -45,8 +47,8 @@ class Recipe(object):
# Allow to define specific ruby executable. If not, take just 'ruby'
self.ruby_executable = options.get('ruby-executable', 'ruby')
deployment = options.get('deployment', 'false')
self.deployment = bool(strtobool(deployment))
deployment = options.get('deployment')
self.deployment = is_true(deployment) if deployment else not allow_picked_versions()
self.gem_regex = re.compile(r'\s+([\w\-_.]+) \((<|~>|>=) '
r'((\d+\.)*\d+)(, (>=) ((\d+\.)*\d+))?\)')
......
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