Add apt.upgrade() convenience function

this one just does the 'upgrade', but *not* the 'update'
This commit is contained in:
Lance Edgar 2018-09-18 19:10:19 -05:00
parent a5b364a239
commit 96a475d0a6

View file

@ -61,6 +61,16 @@ def update():
sudo('apt-get update')
def upgrade(frontend='noninteractive'):
"""
Perform an ``apt-get upgrade`` operation.
"""
options = ''
if frontend == 'noninteractive':
options = '--option Dpkg::Options::="--force-confdef" --option Dpkg::Options::="--force-confold"'
sudo('DEBIAN_FRONTEND={} apt-get --assume-yes {} upgrade'.format(frontend, options))
def add_repository(repo):
"""
Add a new APT repository