[OE-core] [PATCH 13/23] package_manager.py: reverse archs correctly

Alexander Kanavin alexander.kanavin at linux.intel.com
Fri Nov 10 14:21:40 UTC 2017


On 11/10/2017 08:27 AM, Robert Yang wrote:

> -        if arch_var == None:
> -            self.archs = self.d.getVar('ALL_MULTILIB_PACKAGE_ARCHS').replace("-","_")
> +
> +        if arch_var:
> +            self.archs = self.d.getVar(arch_var).replace("-","_").split()
> +        else:
> +            self.archs = self.d.getVar('ALL_MULTILIB_PACKAGE_ARCHS').replace("-","_").split()
> +        # Reverse archs to ensure the -best- match is listed firstly, but need
> +        # make sure not mixed with multilib archs, and let multilib archs have
> +        # higher a priority for multilib image:
> +        # For non-multilib image: (e.g., core-image-minimal)
> +        # machine_arch:package_archs:multilib_archs:allarch_archs
> +        # For multilib image: (e.g., lib32-core-image-minimal)
> +        # machine_arch:multilib_archs:package_archs:allarch_archs
> +        package_archs_var = self.d.getVar('PACKAGE_ARCHS').replace("-","_").split()
> +        machine_arch_var = [self.d.getVar('MACHINE_ARCH').replace("-","_")]
> +        package_archs = []
> +        allarch_archs = []
> +        ml_archs = []
> +        machine_arch = []
> +        for arch in self.archs:
> +            if arch in machine_arch_var:
> +                bb.note("Found MACHINE_ARCH: %s" % arch)
> +                machine_arch.append(arch)
> +            elif arch in package_archs_var:
> +                bb.note("Found PACKAGE_ARCH: %s" % arch)
> +                package_archs.append(arch)
> +            elif arch in 'all any noarch'.split():
> +                bb.note("Found allarch: %s" % arch)
> +                allarch_archs.append(arch)
> +            else:
> +                bb.note("Found multilib arch: %s" % arch)
> +                ml_archs.append(arch)
> +        package_archs.reverse()
> +        if machine_arch:
> +            self.archs = machine_arch
> +        mlprefix = self.d.getVar('MLPREFIX')
> +        if ml_archs:
> +            ml_archs.reverse()
> +            if mlprefix:
> +                self.archs += ml_archs + package_archs
> +            else:
> +                self.archs += package_archs + ml_archs
>           else:
> -            self.archs = self.d.getVar(arch_var).replace("-","_")
> +            self.archs = package_archs
> +
> +        self.archs += allarch_archs
> +        self.archs = ' '.join(self.archs)
> +        bb.note("The archs used by package manager: %s" % self.archs)
> +

Can you place all of this in a helper function please?

Alex



More information about the Openembedded-core mailing list