* [PATCH] packagegroup/allarch: Convert to use allarch class
@ 2012-11-25 20:23 Richard Purdie
2012-11-26 11:12 ` Otavio Salvador
0 siblings, 1 reply; 2+ messages in thread
From: Richard Purdie @ 2012-11-25 20:23 UTC (permalink / raw)
To: openembedded-core
Currently there is some odd behaviour of the packagegroup class in relation
to sstate since it sets PACKAGE_ARCH = "all" but does not use the allarch class
leading to it being undetected by sstate.
Previously it was not possible to use allarch as the recipe couldn't "undo"
settings made by the allarch class. Since this no longer happens when
PACKAGE_ARCH != all, we can use the allarch class.
This patch also fixes up one case we need to preserve TRANSLATED_TARGET_ARCH
and ensures sstate only assumes allarch when PACKAGE_ARCH is "all".
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
diff --git a/meta/classes/packagegroup.bbclass b/meta/classes/packagegroup.bbclass
index e0e5b1c..fc67302 100644
--- a/meta/classes/packagegroup.bbclass
+++ b/meta/classes/packagegroup.bbclass
@@ -13,7 +13,7 @@ PACKAGES = "${PN}"
# By default, packagegroup packages do not depend on a certain architecture.
# Only if dependencies are modified by MACHINE_FEATURES, packages
# need to be set to MACHINE_ARCH after inheriting packagegroup.bbclass
-PACKAGE_ARCH = "all"
+inherit allarch
# This automatically adds -dbg and -dev flavours of all PACKAGES
# to the list. Their dependencies (RRECOMMENDS) are handled as usual
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index e1bc89d..6de35e6 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -46,7 +46,7 @@ python () {
d.setVar('SSTATE_PKGARCH', d.expand("${SDK_ARCH}"))
elif bb.data.inherits_class('cross-canadian', d):
d.setVar('SSTATE_PKGARCH', d.expand("${SDK_ARCH}_${PACKAGE_ARCH}"))
- elif bb.data.inherits_class('allarch', d):
+ elif bb.data.inherits_class('allarch', d) and d.getVar("PACKAGE_ARCH", True) == "all":
d.setVar('SSTATE_PKGARCH', "allarch")
else:
d.setVar('SSTATE_MANMACH', d.expand("${PACKAGE_ARCH}"))
diff --git a/meta/recipes-core/packagegroups/packagegroup-cross-canadian.bb b/meta/recipes-core/packagegroups/packagegroup-cross-canadian.bb
index cb2fb1a..87c7dce 100644
--- a/meta/recipes-core/packagegroups/packagegroup-cross-canadian.bb
+++ b/meta/recipes-core/packagegroups/packagegroup-cross-canadian.bb
@@ -3,6 +3,9 @@ PN = "packagegroup-cross-canadian-${TRANSLATED_TARGET_ARCH}"
PR = "r0"
LICENSE = "MIT"
+# Save TRANSLATED_TARGET_ARCH before allarch tramples it
+TRANSLATED_TARGET_ARCH := "${TRANSLATED_TARGET_ARCH}"
+
inherit cross-canadian packagegroup
PACKAGEGROUP_DISABLE_COMPLEMENTARY = "1"
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] packagegroup/allarch: Convert to use allarch class
2012-11-25 20:23 [PATCH] packagegroup/allarch: Convert to use allarch class Richard Purdie
@ 2012-11-26 11:12 ` Otavio Salvador
0 siblings, 0 replies; 2+ messages in thread
From: Otavio Salvador @ 2012-11-26 11:12 UTC (permalink / raw)
To: Richard Purdie; +Cc: openembedded-core
On Sun, Nov 25, 2012 at 6:23 PM, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> Currently there is some odd behaviour of the packagegroup class in relation
> to sstate since it sets PACKAGE_ARCH = "all" but does not use the allarch class
> leading to it being undetected by sstate.
>
> Previously it was not possible to use allarch as the recipe couldn't "undo"
> settings made by the allarch class. Since this no longer happens when
> PACKAGE_ARCH != all, we can use the allarch class.
Now I see the usecase! :)
> This patch also fixes up one case we need to preserve TRANSLATED_TARGET_ARCH
> and ensures sstate only assumes allarch when PACKAGE_ARCH is "all".
This seems better to be split onto another patch.
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---
> diff --git a/meta/classes/packagegroup.bbclass b/meta/classes/packagegroup.bbclass
> index e0e5b1c..fc67302 100644
> --- a/meta/classes/packagegroup.bbclass
> +++ b/meta/classes/packagegroup.bbclass
> @@ -13,7 +13,7 @@ PACKAGES = "${PN}"
> # By default, packagegroup packages do not depend on a certain architecture.
> # Only if dependencies are modified by MACHINE_FEATURES, packages
> # need to be set to MACHINE_ARCH after inheriting packagegroup.bbclass
> -PACKAGE_ARCH = "all"
> +inherit allarch
>
> # This automatically adds -dbg and -dev flavours of all PACKAGES
> # to the list. Their dependencies (RRECOMMENDS) are handled as usual
> diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
> index e1bc89d..6de35e6 100644
> --- a/meta/classes/sstate.bbclass
> +++ b/meta/classes/sstate.bbclass
> @@ -46,7 +46,7 @@ python () {
> d.setVar('SSTATE_PKGARCH', d.expand("${SDK_ARCH}"))
> elif bb.data.inherits_class('cross-canadian', d):
> d.setVar('SSTATE_PKGARCH', d.expand("${SDK_ARCH}_${PACKAGE_ARCH}"))
> - elif bb.data.inherits_class('allarch', d):
> + elif bb.data.inherits_class('allarch', d) and d.getVar("PACKAGE_ARCH", True) == "all":
> d.setVar('SSTATE_PKGARCH', "allarch")
> else:
> d.setVar('SSTATE_MANMACH', d.expand("${PACKAGE_ARCH}"))
> diff --git a/meta/recipes-core/packagegroups/packagegroup-cross-canadian.bb b/meta/recipes-core/packagegroups/packagegroup-cross-canadian.bb
> index cb2fb1a..87c7dce 100644
> --- a/meta/recipes-core/packagegroups/packagegroup-cross-canadian.bb
> +++ b/meta/recipes-core/packagegroups/packagegroup-cross-canadian.bb
> @@ -3,6 +3,9 @@ PN = "packagegroup-cross-canadian-${TRANSLATED_TARGET_ARCH}"
> PR = "r0"
> LICENSE = "MIT"
>
> +# Save TRANSLATED_TARGET_ARCH before allarch tramples it
> +TRANSLATED_TARGET_ARCH := "${TRANSLATED_TARGET_ARCH}"
> +
> inherit cross-canadian packagegroup
>
> PACKAGEGROUP_DISABLE_COMPLEMENTARY = "1"
>
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
--
Otavio Salvador O.S. Systems
E-mail: otavio@ossystems.com.br http://www.ossystems.com.br
Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-11-26 11:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-25 20:23 [PATCH] packagegroup/allarch: Convert to use allarch class Richard Purdie
2012-11-26 11:12 ` Otavio Salvador
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.