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,10 +184,10 @@ class Recipe(object): ...@@ -184,10 +184,10 @@ 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
...@@ -234,7 +234,9 @@ class Recipe(object): ...@@ -234,7 +234,9 @@ 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('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') log.info('This shared package has been installed by other package')
return parts return parts
......
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