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

WIP

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