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