Commit f5b4cb49 authored by Jondy Zhao's avatar Jondy Zhao

Add log message when checking share option

parent ea57bedd
......@@ -1086,6 +1086,8 @@ Use option ``share`` to install a share pacakge.
Uninstalling package.
Uninstalling package-2.
Installing package.
package: Checking whether package is installed at share path: /usr/local/bin
package: could not find promise "/usr/local/bin/mypackage.exe"
package: [ENV] TMP = /sample_buildout/parts/package/tmp
package: Extracting package to /sample_buildout/parts/package__compile__
configure --prefix=/sample_buildout/parts/package
......@@ -1110,6 +1112,7 @@ Do nothing if one package has been installed.
>>> print system(buildout)
Uninstalling package.
Installing package.
package: Checking whether package is installed at share path: /usr/local/bin
package: This shared package has been installed by other package
For even more specific needs you can write your own recipe that uses
......
......@@ -184,11 +184,11 @@ class Recipe(object):
def check_promises(self, log=None):
result = True
log = logging.getLogger(self.name)
for path in self.options['promises'].splitlines():
if not os.path.exists(path):
result = False
if log is not None:
log.warning('could not find promise "%s"' % path)
log.warning('could not find promise "%s"' % path)
return result
def call_script(self, script):
......@@ -234,9 +234,11 @@ class Recipe(object):
parts = []
# In share mode, do nothing if package has been installed.
if (not self.options['share'] == '') and self.check_promises():
log.info('This shared package has been installed by other package')
return parts
if (not self.options['share'] == ''):
log.info('Checking whether package is installed at share path: %s' % self.options['share'])
if self.check_promises(log):
log.info('This shared package has been installed by other package')
return parts
make_cmd = self.options.get('make-binary', 'make').strip()
make_options = ' '.join(self.options.get('make-options', '').split())
......
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