From 533389f36e2d161622f5b4ab00d40ec0df5aed3e Mon Sep 17 00:00:00 2001 From: Brett Holman Date: Fri, 8 Apr 2022 17:36:49 -0600 Subject: [PATCH] Grab downstream patches --- cloudinit/distros/gentoo.py | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/cloudinit/distros/gentoo.py b/cloudinit/distros/gentoo.py index 4eb76da838c..37217fe4332 100644 --- a/cloudinit/distros/gentoo.py +++ b/cloudinit/distros/gentoo.py @@ -218,23 +218,26 @@ def set_timezone(self, tz): distros.set_etc_timezone(tz=tz, tz_file=self._find_tz_file(tz)) def package_command(self, command, args=None, pkgs=None): - if pkgs is None: - pkgs = [] - cmd = list("emerge") # Redirect output cmd.append("--quiet") - if args and isinstance(args, str): - cmd.append(args) - elif args and isinstance(args, list): - cmd.extend(args) + if command == "upgrade": + cmd.extend(["--update", "world"]) + else: + if pkgs is None: + pkgs = [] + + if args and isinstance(args, str): + cmd.append(args) + elif args and isinstance(args, list): + cmd.extend(args) - if command: - cmd.append(command) + if command: + cmd.append(command) - pkglist = util.expand_package_list("%s-%s", pkgs) - cmd.extend(pkglist) + pkglist = util.expand_package_list("%s-%s", pkgs) + cmd.extend(pkglist) # Allow the output of this to flow outwards (ie not be captured) subp.subp(cmd, capture=False) @@ -243,7 +246,7 @@ def update_package_sources(self): self._runner.run( "update-sources", self.package_command, - ["-u", "world"], + ["--sync"], freq=PER_INSTANCE, )