diff options
author | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-11-17 23:33:21 (GMT) |
---|---|---|
committer | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-11-17 23:37:27 (GMT) |
commit | 8605e5b594c4fc59e06cd469cf509ba149193469 (patch) | |
tree | 148826a95a63d3782f074f8d06a48e4e94c1e1c2 /devbot/distro.py | |
parent | c3bf198ccd64684ecc8e190bf17ccc3e41ff21ae (diff) |
Respect the interactive flag in ubuntu
Diffstat (limited to 'devbot/distro.py')
-rw-r--r-- | devbot/distro.py | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/devbot/distro.py b/devbot/distro.py index 13e4456..c432c08 100644 --- a/devbot/distro.py +++ b/devbot/distro.py @@ -87,7 +87,12 @@ class UbuntuPackageManager: self._cache = apt.cache.Cache() def install_packages(self, packages): - args = ["apt-get", "install"] + args = ["apt-get"] + + if not self._interactive: + args.append("-y") + + args.append("install") args.extend(packages) command.run_with_sudo(args, test=self._test) @@ -100,7 +105,15 @@ class UbuntuPackageManager: def update(self): command.run_with_sudo(["apt-get", "update"], test=self._test) - command.run_with_sudo(["apt-get", "-y", "upgrade"], test=self._test) + + args = ["apt-get"] + + if not self._interactive: + args.append("-y") + + args.append("upgrade") + + command.run_with_sudo(args, test=self._test) def find_all(self): return [package.name for package in self._cache |