[OE-core] [PATCH] package_manager: rpm: remove update-alternatives correctly

Alexander Kanavin alexander.kanavin at linux.intel.com
Tue Sep 26 12:21:20 UTC 2017


On 09/26/2017 03:03 PM, Mikko Ylinen wrote:
> @@ -614,13 +614,16 @@ class RpmPM(PackageManager):
>               self._invoke_dnf(["remove"] + pkgs)
>           else:
>               cmd = bb.utils.which(os.getenv('PATH'), "rpm")
> -            args = ["-e", "--nodeps", "--root=%s" %self.target_rootfs]
> +            args = ["-e", "-v", "--nodeps", "--root=%s" %self.target_rootfs]
>   
> -            try:
> -                output = subprocess.check_output([cmd] + args + pkgs, stderr=subprocess.STDOUT).decode("utf-8")
> -            except subprocess.CalledProcessError as e:
> -                bb.fatal("Could not invoke rpm. Command "
> -                     "'%s' returned %d:\n%s" % (' '.join([cmd] + args + pkgs), e.returncode, e.output.decode("utf-8")))
> +            for pkg in pkgs:
> +                try:
> +                    bb.note("Running %s" % ' '.join([cmd] + args + [pkg]))
> +                    output = subprocess.check_output([cmd] + args + [pkg], stderr=subprocess.STDOUT).decode("utf-8")
> +                    bb.note(output)
> +                except subprocess.CalledProcessError as e:
> +                    bb.fatal("Could not invoke rpm. Command "
> +                         "'%s' returned %d:\n%s" % (' '.join([cmd] + args + [pkg]), e.returncode, e.output.decode("utf-8")))
>   
>       def upgrade(self):
>           self._prepare_pkg_transaction()
> 

I'm worried this might significantly slow down image creation. How about 
fixing this in rootfs.py: first remove everything except 
update-alternatives, then remove that?


Alex



More information about the Openembedded-core mailing list