Commit 27c7aead authored by Nicolas Wavrant's avatar Nicolas Wavrant

WIP

parent e837aff8
......@@ -548,6 +548,11 @@ class Buildout(DictMixin):
os.symlink(os.path.join(shared_path, name, item), new_item_path)
for item in shared_item_set - current_item_set:
os.symlink(os.path.join(shared_path, item), item)
if item == '.installed.cfg':
self.installed_part_options = self._read_installed_part_options()
self._save_installed_options()
elif link:
options['extends'] = link
......@@ -649,13 +654,6 @@ class Buildout(DictMixin):
self.install(())
def install(self, install_args):
options = self['buildout']
link = options.get('link', "")
if link and shared_path:
os.environ.set('BUILDOUT_HOME', shared_path)
self._save_installed_options()
return
try:
self._install_parts(install_args)
finally:
......@@ -728,6 +726,7 @@ class Buildout(DictMixin):
# uninstall parts that are no-longer used or who's configs
# have changed
import pdb;pdb.set_trace()
for part in reversed(installed_parts):
if part in install_parts:
old_options = installed_part_options[part].copy()
......@@ -958,8 +957,8 @@ class Buildout(DictMixin):
def _read_installed_part_options(self):
old = self['buildout']['installed']
link = options.get('link', "")
new_path = os.curdir
link = self['buildout'].get('link', "")
new_path = os.path.realpath(os.curdir)
shared_path = shared_stack_path(link)
if old and os.path.isfile(old):
......@@ -973,7 +972,10 @@ class Buildout(DictMixin):
for k, v in _spacey_defaults:
value = value.replace(k, v)
options[option] = value
result[section] = self.Options(self, section, options.replace(shared_path, new_path))
if link and value.startswith(shared_path):
value = value.replace(shared_path, new_path)
options[option] = value
result[section] = self.Options(self, section, options)
return result
else:
......@@ -1827,8 +1829,16 @@ def _open(base, filename, seen, dl_options, override, downloaded):
os.remove(downloaded_filename)
options = result.get('buildout', {})
# link = options.get('link', "")
# shared_path = shared_stack_path(link)
extends = options.pop('extends', [])
if extends:
extends = extends.split()
link = options.get('link', "")
shared_path = shared_stack_path(link)
if link and shared_path:
extends.append(link)
# if link and shared_path:
# shared_item_set = set(os.listdir(shared_path))
# current_item_set = set(os.listdir('.'))
......@@ -1839,7 +1849,6 @@ def _open(base, filename, seen, dl_options, override, downloaded):
# elif link:
# options['extends'] = link
extends = options.pop('extends', None)
if 'extended-by' in options:
raise zc.buildout.UserError(
'No-longer supported "extended-by" option found in %s.' %
......@@ -1862,7 +1871,6 @@ def _open(base, filename, seen, dl_options, override, downloaded):
dl_options = _update_section(dl_options, result['buildout'])
if extends:
extends = extends.split()
eresult = _open(base, extends.pop(0), seen, dl_options, override,
downloaded)
for fname in extends:
......
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