Imported Debian patch 4.7.2-3

This commit is contained in:
Timo Aaltonen
2019-05-06 08:43:34 +03:00
committed by Mario Fetka
parent 27edeba051
commit 8bc559c5a1
917 changed files with 1068993 additions and 1184676 deletions

View File

@@ -58,7 +58,8 @@ def _get_usage(configurable_class):
def install_tool(configurable_class, command_name, log_file_name,
debug_option=False, verbose=False, console_format=None,
use_private_ccache=True, uninstall_log_file_name=None):
use_private_ccache=True, uninstall_log_file_name=None,
ignore_return_codes=()):
"""
Some commands represent multiple related tools, e.g.
``ipa-server-install`` and ``ipa-server-install --uninstall`` would be
@@ -72,6 +73,8 @@ def install_tool(configurable_class, command_name, log_file_name,
:param console_format: logging format for stderr
:param use_private_ccache: a temporary ccache is created and used
:param uninstall_log_file_name: if not None the log for uninstall
:param ignore_return_codes: tuple of error codes to not log errors
for. Let the caller do it if it wants.
"""
if uninstall_log_file_name is not None:
uninstall_kwargs = dict(
@@ -81,6 +84,7 @@ def install_tool(configurable_class, command_name, log_file_name,
debug_option=debug_option,
verbose=verbose,
console_format=console_format,
ignore_return_codes=ignore_return_codes,
)
else:
uninstall_kwargs = None
@@ -98,12 +102,14 @@ def install_tool(configurable_class, command_name, log_file_name,
console_format=console_format,
uninstall_kwargs=uninstall_kwargs,
use_private_ccache=use_private_ccache,
ignore_return_codes=ignore_return_codes,
)
)
def uninstall_tool(configurable_class, command_name, log_file_name,
debug_option=False, verbose=False, console_format=None):
debug_option=False, verbose=False, console_format=None,
ignore_return_codes=()):
return type(
'uninstall_tool({0})'.format(configurable_class.__name__),
(UninstallTool,),
@@ -115,6 +121,7 @@ def uninstall_tool(configurable_class, command_name, log_file_name,
debug_option=debug_option,
verbose=verbose,
console_format=console_format,
ignore_return_codes=ignore_return_codes,
)
)

View File

@@ -35,12 +35,12 @@ class Installable(core.Configurable):
def _get_components(self):
components = super(Installable, self)._get_components()
if self.uninstalling: # pylint: disable=using-constant-test
if self.uninstalling:
components = reversed(list(components))
return components
def _configure(self):
if self.uninstalling: # pylint: disable=using-constant-test
if self.uninstalling:
return self._uninstall()
else:
return self._install()

View File

@@ -11,7 +11,7 @@ import sys
import six
class from_:
class from_(object):
"""
Wrapper for delegating to a subgenerator.