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