Skip to content
This repository was archived by the owner on Mar 13, 2024. It is now read-only.

Commit ba19928

Browse files
committed
Fixes noninteractive enforcement
1 parent fd875af commit ba19928

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

updatewrapper/flavor/debian.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,23 @@
33
from updatewrapper.flavor import FlavorBase
44

55

6+
ENV_VARS = 'DEBIAN_FRONTEND=noninteractive APT_LISTCHANGES_FRONTEND=text '
7+
8+
69
class Debian(FlavorBase):
710
def __init__(self, host, dist_upgrade=False, **kwargs):
811
self.command = 'dist-upgrade' if dist_upgrade else 'upgrade'
912

1013
super().__init__(host)
1114

1215
def update_cache(self):
13-
return self.host.run('DEBIAN_FRONTEND=noninteractive apt-get update')
16+
return self.host.run(ENV_VARS + 'apt-get update')
1417

1518
def check_update(self):
16-
return self.host.run('DEBIAN_FRONTEND=noninteractive apt-get --show-upgraded --assume-no ' + self.command)
19+
return self.host.run(ENV_VARS + 'apt-get --show-upgraded --assume-no ' + self.command)
1720

1821
def has_update(self, returncode, stdout, stderr):
1922
return to_bytes('The following packages will be upgraded') in stdout
2023

2124
def perform_update(self):
22-
return self.host.run('DEBIAN_FRONTEND=noninteractive apt-get --show-upgraded --assume-yes ' + self.command)
25+
return self.host.run(ENV_VARS + 'apt-get --show-upgraded --assume-yes ' + self.command)

0 commit comments

Comments
 (0)