Commit ca6a2f94 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

zc.recipe.egg: Improve on the fly pathces.

Now specified patches are automatically applied on required eggs as well.
parent 53fc6369
......@@ -860,6 +860,8 @@ class Installer:
logger.debug('Adding required %r', str(req))
_log_requirement(ws, req)
self._env.scan(, {}, patch_dict=patch_dict))
for dist in self._get_dist(req, ws,
......@@ -51,17 +51,21 @@ class Eggs(object):
options['develop-eggs-directory'] = b_options['develop-eggs-directory']
options['_d'] = options['develop-eggs-directory'] # backward compat.
def _get_patch_dict(self, options, distribution_list):
def _get_patch_dict(self, options, egg=None):
patch_dict = {}
global_patch_binary = options.get('patch-binary', 'patch')
if egg:
egg = re.sub('[<>=].*', '', egg)
egg_list = [egg]
egg_list = [x[:-8] for x in options.keys() if x.endswith('-patches')]
def get_option(egg, key, default):
if len(distribution_list) == 1:
if len(egg_list) == 1:
return options.get('%s-%s' % (egg, key),
options.get(key, default))
return options.get('%s-%s' % (egg, key), default)
for distribution in distribution_list:
egg = re.sub('[<>=].*', '', distribution)
for egg in egg_list:
patches = filter(lambda x:x,
map(lambda x:x.strip(),
get_option(egg, 'patches', '').splitlines()))
......@@ -103,7 +107,7 @@ class Eggs(object):
[options['develop-eggs-directory'], options['eggs-directory']]
patch_dict = self._get_patch_dict(options, distributions)
patch_dict = self._get_patch_dict(options)
ws = zc.buildout.easy_install.install(
distributions, options['eggs-directory'],
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