From: "Eric Bénard" <eric@eukrea.com>
To: openembedded-devel@lists.openembedded.org
Cc: "Eric Bénard" <eric@eukrea.com>
Subject: [PATCH] handle PACKAGE_ARCH change in an amend.inc
Date: Sun, 21 Nov 2010 16:19:52 +0100 [thread overview]
Message-ID: <1290352792-2563-1-git-send-email-eric@eukrea.com> (raw)
In-Reply-To: <4CE56C6B.1050009@eukrea.com>
* setting PACKAGE_ARCH = "${MACHINE_ARCH}" in an amend.inc actually
leads to a package with the correct machine arch but the
work/stage/stamp dirs are not correct because MULTIMACH_ARCH is not
updated after amend.inc is parsed.
* this patch :
- factorizes the code which compute MULTIMACH_ARCH in base.bbclass
- updates MULTIMACH_ARCH if required by an amend.inc
Signed-off-by: Eric Bénard <eric@eukrea.com>
---
classes/amend.bbclass | 2 +
classes/base.bbclass | 53 ++++++++++++++++++++++++++----------------------
2 files changed, 31 insertions(+), 24 deletions(-)
diff --git a/classes/amend.bbclass b/classes/amend.bbclass
index a03de64..048a8f3 100644
--- a/classes/amend.bbclass
+++ b/classes/amend.bbclass
@@ -42,4 +42,6 @@ python () {
depends = set()
depends |= set(newdata)
d.setVar("__depends", depends)
+
+ set_multimach_arch(d)
}
diff --git a/classes/base.bbclass b/classes/base.bbclass
index 308498f..90a481b 100644
--- a/classes/base.bbclass
+++ b/classes/base.bbclass
@@ -288,6 +288,34 @@ addtask build
do_build = ""
do_build[func] = "1"
+def set_multimach_arch(d):
+ # 'multimachine' handling
+ mach_arch = bb.data.getVar('MACHINE_ARCH', d, 1)
+ pkg_arch = bb.data.getVar('PACKAGE_ARCH', d, 1)
+
+ #
+ # We always try to scan SRC_URI for urls with machine overrides
+ # unless the package sets SRC_URI_OVERRIDES_PACKAGE_ARCH=0
+ #
+ override = bb.data.getVar('SRC_URI_OVERRIDES_PACKAGE_ARCH', d, 1)
+ if override != '0' and is_machine_specific(d):
+ bb.data.setVar('PACKAGE_ARCH', "${MACHINE_ARCH}", d)
+ bb.data.setVar('MULTIMACH_ARCH', mach_arch, d)
+ return
+
+ multiarch = pkg_arch
+
+ packages = bb.data.getVar('PACKAGES', d, 1).split()
+ for pkg in packages:
+ pkgarch = bb.data.getVar("PACKAGE_ARCH_%s" % pkg, d, 1)
+
+ # We could look for != PACKAGE_ARCH here but how to choose
+ # if multiple differences are present?
+ # Look through PACKAGE_ARCHS for the priority order?
+ if pkgarch and pkgarch == mach_arch:
+ multiarch = mach_arch
+ break
+
python () {
import exceptions
@@ -363,30 +391,7 @@ python () {
# Already machine specific - nothing further to do
return
- #
- # We always try to scan SRC_URI for urls with machine overrides
- # unless the package sets SRC_URI_OVERRIDES_PACKAGE_ARCH=0
- #
- override = bb.data.getVar('SRC_URI_OVERRIDES_PACKAGE_ARCH', d, 1)
- if override != '0' and is_machine_specific(d):
- bb.data.setVar('PACKAGE_ARCH', "${MACHINE_ARCH}", d)
- bb.data.setVar('MULTIMACH_ARCH', mach_arch, d)
- return
-
- multiarch = pkg_arch
-
- packages = bb.data.getVar('PACKAGES', d, 1).split()
- for pkg in packages:
- pkgarch = bb.data.getVar("PACKAGE_ARCH_%s" % pkg, d, 1)
-
- # We could look for != PACKAGE_ARCH here but how to choose
- # if multiple differences are present?
- # Look through PACKAGE_ARCHS for the priority order?
- if pkgarch and pkgarch == mach_arch:
- multiarch = mach_arch
- break
-
- bb.data.setVar('MULTIMACH_ARCH', multiarch, d)
+ set_multimach_arch(d)
}
EXPORT_FUNCTIONS do_setscene do_fetch do_unpack do_configure do_compile do_install do_package
--
1.6.3.3
next prev parent reply other threads:[~2010-11-21 15:23 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-17 13:55 [PATCH] amend.bbclass: handle PACKAGE_ARCH change in an amend.inc Eric Bénard
2010-11-18 18:03 ` Denys Dmytriyenko
2010-11-18 18:11 ` Eric Bénard
2010-11-18 18:46 ` Paul Menzel
2010-11-21 15:19 ` Eric Bénard [this message]
2010-11-21 16:28 ` [PATCH] " Khem Raj
2010-11-21 17:53 ` Chris Larson
2010-11-21 18:46 ` Eric Bénard
2010-11-21 19:42 ` Eric Bénard
2010-11-21 23:16 ` Chris Larson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1290352792-2563-1-git-send-email-eric@eukrea.com \
--to=eric@eukrea.com \
--cc=openembedded-devel@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox