Commit f9e37369 authored by Jim Fulton's avatar Jim Fulton

Error helpfully if install-from-cache and offline are used together.

parent 7153e708
...@@ -335,8 +335,14 @@ class Buildout(DictMixin): ...@@ -335,8 +335,14 @@ class Buildout(DictMixin):
zc.buildout.easy_install.download_cache(download_cache) zc.buildout.easy_install.download_cache(download_cache)
zc.buildout.easy_install.install_from_cache( if bool_option(options, 'install-from-cache'):
bool_option(options, 'install-from-cache')) if self.offline:
raise zc.buildout.UserError(
"install-from-cache can't be used with offline mode.\n"
"Nothing is installed, even fromn cache, in offline\n"
"mode, which might better be called 'no-install mode'.\n"
)
zc.buildout.easy_install.install_from_cache(True)
# "Use" each of the defaults so they aren't reported as unused options. # "Use" each of the defaults so they aren't reported as unused options.
for name in _buildout_default_options: for name in _buildout_default_options:
......
...@@ -2788,6 +2788,24 @@ def bootstrap_honors_relative_paths(): ...@@ -2788,6 +2788,24 @@ def bootstrap_honors_relative_paths():
sys.exit(zc.buildout.buildout.main()) sys.exit(zc.buildout.buildout.main())
""" """
def cant_use_install_from_cache_and_offline_together():
r"""
>>> write('buildout.cfg',
... '''
... [buildout]
... parts =
... offline = true
... install-from-cache = true
... ''')
>>> print_(system(join('bin', 'buildout')), end='') # doctest: +ELLIPSIS
While:
Initializing.
Error: install-from-cache can't be used with offline mode.
Nothing is installed, even fromn cache, in offline
mode, which might better be called 'no-install mode'.
<BLANKLINE>
"""
###################################################################### ######################################################################
......
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