From: Martin Jansa <martin.jansa@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: [RFC][PATCH 1/2] packagedata: show error when there are multiple pkgdata directories
Date: Wed, 3 Apr 2013 12:14:33 +0200 [thread overview]
Message-ID: <1364984074-3636-1-git-send-email-Martin.Jansa@gmail.com> (raw)
In-Reply-To: <20130320202206.GD3220@jama>
* when PACKAGE_ARCH is changed e.g. from MACHINE_ARCH to TUNE_PKGARCH
get_subpkgedata_fn is still reading old MACHINE_ARCH directory instead of newer with TUNE_PKGARCH
---
meta/lib/oe/packagedata.py | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/meta/lib/oe/packagedata.py b/meta/lib/oe/packagedata.py
index 62fd718..2533700 100644
--- a/meta/lib/oe/packagedata.py
+++ b/meta/lib/oe/packagedata.py
@@ -34,11 +34,18 @@ def get_subpkgedata_fn(pkg, d):
dirs = all_pkgdatadirs(d)
pkgdata = d.expand('${TMPDIR}/pkgdata/')
+ found = None
for dir in dirs:
fn = pkgdata + dir + pkg
if os.path.exists(fn):
- return fn
- return d.expand('${PKGDATA_DIR}/runtime/%s' % pkg)
+ if found:
+ bb.error("More then one pkgdata dir found for pkg '%s' ('%s', '%s'), returning first" % (pkg, found, fn))
+ continue
+ found = fn
+ if found:
+ return found
+ else:
+ return d.expand('${PKGDATA_DIR}/runtime/%s' % pkg)
def has_subpkgdata(pkg, d):
return os.access(get_subpkgedata_fn(pkg, d), os.R_OK)
@@ -68,6 +75,7 @@ def read_subpkgdata_dict(pkg, d):
return ret
def _pkgmap(d):
+ import bb
"""Return a dictionary mapping package to recipe name."""
target_os = d.getVar("TARGET_OS", True)
@@ -85,6 +93,7 @@ def _pkgmap(d):
continue
for pn in filter(lambda f: not os.path.isdir(os.path.join(pkgdatadir, f)), files):
+ bb.warn("Trying path '%s'" % os.path.join(pkgdatadir, pn))
try:
pkgdata = read_pkgdatafile(os.path.join(pkgdatadir, pn))
except OSError:
--
1.8.1.5
next prev parent reply other threads:[~2013-04-03 10:31 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-20 19:26 [PATCH/RFC] netbase: inherit allarch Andreas Oberritter
2013-03-20 20:18 ` Martin Jansa
2013-03-20 20:22 ` Martin Jansa
2013-04-03 10:14 ` Martin Jansa [this message]
2013-04-03 10:14 ` [RFC][PATCH 2/2] packagedata: Show error when trying to change PE/PV/PR from runtime/pkgdata Martin Jansa
2013-04-04 15:39 ` [RFC][PATCH 1/2] packagedata: show error when there are multiple pkgdata directories Martin Jansa
2013-04-04 15:48 ` Paul Eggleton
2013-04-04 15:58 ` Richard Purdie
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=1364984074-3636-1-git-send-email-Martin.Jansa@gmail.com \
--to=martin.jansa@gmail.com \
--cc=openembedded-core@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