Pass arbitrary kwargs along, for apt.install()
also return the result
This commit is contained in:
parent
6cb6ddaba7
commit
6cf17a054b
|
@ -36,12 +36,12 @@ def install(c, *packages, **kwargs):
|
||||||
"""
|
"""
|
||||||
Install one or more packages via ``apt-get install``.
|
Install one or more packages via ``apt-get install``.
|
||||||
"""
|
"""
|
||||||
frontend = kwargs.get('frontend', 'noninteractive')
|
frontend = kwargs.pop('frontend', 'noninteractive')
|
||||||
target = kwargs.get('target_release')
|
target = kwargs.pop('target_release', None)
|
||||||
target = '--target-release={}'.format(target) if target else ''
|
target = '--target-release={}'.format(target) if target else ''
|
||||||
force_yes = ' --force-yes' if kwargs.get('force_yes') else ''
|
force_yes = ' --force-yes' if kwargs.pop('force_yes', False) else ''
|
||||||
c.sudo('DEBIAN_FRONTEND={} apt-get --assume-yes {}{} install {}'.format(
|
return c.sudo('DEBIAN_FRONTEND={} apt-get --assume-yes {}{} install {}'.format(
|
||||||
frontend, target, force_yes, ' '.join(packages)))
|
frontend, target, force_yes, ' '.join(packages)), **kwargs)
|
||||||
|
|
||||||
|
|
||||||
def purge(c, *packages):
|
def purge(c, *packages):
|
||||||
|
|
Loading…
Reference in a new issue