[Piuparts-commits] [piuparts] 04/09: p: factor out an apt_get_install method
Holger Levsen
holger at moszumanska.debian.org
Sat May 16 14:51:33 UTC 2015
This is an automated email from the git hooks/post-receive script.
holger pushed a commit to branch develop
in repository piuparts.
commit fdbc6053ab66460c1bb6ce2bd837f35fdb12dab7
Author: Andreas Beckmann <anbe at debian.org>
Date: Mon May 4 21:34:29 2015 +0200
p: factor out an apt_get_install method
'apt-get install' is capable of more than just installing ...
Signed-off-by: Andreas Beckmann <anbe at debian.org>
---
piuparts.py | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/piuparts.py b/piuparts.py
index 4d1db23..96171d6 100644
--- a/piuparts.py
+++ b/piuparts.py
@@ -1179,21 +1179,23 @@ class Chroot:
self.run(["apt-cache", "policy"])
self.run(["apt-cache", "policy"] + unqualify(packages))
- apt_get_install = ["apt-get", "-y"]
- apt_get_install.extend(settings.distro_config.get_target_flags(
- os.environ["PIUPARTS_DISTRIBUTION"]))
- apt_get_install.append("install")
- apt_get_install.extend(packages)
if settings.list_installed_files:
pre_info = self.save_meta_data()
- self.run(apt_get_install)
+
+ target_flags = settings.distro_config.get_target_flags(os.environ["PIUPARTS_DISTRIBUTION"])
+ self.apt_get_install(to_install=packages, flags=target_flags)
+
+ if settings.list_installed_files:
self.list_installed_files(pre_info, self.save_meta_data())
- else:
- self.run(apt_get_install)
if with_scripts:
self.run_scripts("post_install")
+ def apt_get_install(self, to_install=[], flags=[]):
+ command = ["apt-get", "-y"] + flags + ["install"]
+ command.extend(to_install)
+ self.run(command)
+
def get_selections(self):
"""Get current package selections in a chroot."""
(status, output) = self.run(["dpkg", "--get-selections", "*"])
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/piuparts/piuparts.git
More information about the Piuparts-commits
mailing list