Commit 4b749b0a authored by Yusei Tahara's avatar Yusei Tahara

Disable shared feature by default since it is stil an experimental one. Enable...

Disable shared feature by default since it is stil an experimental one. Enable it only if shared-part is defined.
parent 7e417d69
......@@ -1017,7 +1017,7 @@ Use option ``shared`` to install a shared pacakge.
>>> os.mkdir(shared_dir)
If no shared-part is set, and shared is True, an error is raised:
If no shared-part is set, and shared is True, shared feature is not used:
>>> write('buildout.cfg',
... """
... [buildout]
......@@ -1031,12 +1031,13 @@ If no shared-part is set, and shared is True, an error is raised:
... """% src)
>>> print system(buildout) #doctest:+ELLIPSIS
While:
Installing.
Getting section package.
Initializing section package.
...
ValueError: Set ${buildout:shared-part} for shared feature
Uninstalling package.
Uninstalling package-2.
Installing package.
package: [ENV] TMP = /sample_buildout/parts/package/tmp
configure --prefix=/sample_buildout/parts/package
building package
installing package
If shared-part is set and shared is True, build package failed, the build directory is removed, a build directory__complile__ is left for debugging
>>> _ = system('mv %s/package-0.0.0.tar.gz %s/package-0.0.0.tar.gz.bak' % (src, src))
......@@ -1065,7 +1066,6 @@ If shared-part is set and shared is True, build package failed, the build direct
>>> print system(buildout) #doctest:+ELLIPSIS
package: shared directory .../slapos.recipe.cmmi/slapos/recipe/cmmi/shared/package/... set for package
Uninstalling package.
Uninstalling package-2.
Installing package.
package: Checking whether package is installed at shared path: .../slapos.recipe.cmmi/slapos/recipe/cmmi/shared/package/...
package: [ENV] TMP = .../slapos.recipe.cmmi/slapos/recipe/cmmi/shared/package/.../tmp
......
......@@ -41,12 +41,8 @@ class Recipe(object):
options.update(platform_options)
shared = options.get('shared', '').lower()
if shared == 'true':
if shared == 'true' and buildout['buildout'].get('shared-part', None):
shared_part = buildout['buildout'].get('shared-part', None)
if not shared_part:
raise ValueError(
" Set ${buildout:shared-part} for shared feature")
shared = os.path.join(shared_part.strip().rstrip('/'), self.name)
if not os.path.exists(shared):
os.makedirs(shared)
......@@ -69,6 +65,8 @@ class Recipe(object):
shared = os.path.join(shared, m.hexdigest())
log.info('shared directory %s set for %s', shared, self.name)
else:
shared = ''
options['shared'] = shared
default_location = options['default-location'] = os.path.join(
......@@ -329,7 +327,7 @@ class Recipe(object):
opt['destination'] = compile_dir
opt['strip-top-level-dir'] = 'false'
# no need to shared build for compile dir
opt['shared'] = 'False'
opt['shared'] = 'false'
slapos.recipe.downloadunpacked.Recipe(
self.buildout, self.name, opt).install()
except:
......
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