From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: bitbake-devel <bitbake-devel@lists.openembedded.org>
Subject: [PATCH] cookerdata: Allow bblayers.conf to be found using BBPATH
Date: Thu, 29 Aug 2013 14:27:29 +0100 [thread overview]
Message-ID: <1377782849.1059.1.camel@ted> (raw)
It should be possible to run a build anywhere on the filesystem and have
bitbake find the correct build directory if its set somehow. The BBPATH
variable makes perfect sense for this usage. Therefore use any available
value of BBPATH to search for conf/bblayers.conf before walking the parent
directory structure.
This restores the option of being able to run bitbake from anywhere if
the user has set things up to operate in that environment.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
diff --git a/bitbake/lib/bb/cookerdata.py b/bitbake/lib/bb/cookerdata.py
index 8a0bc22..0b278b1 100644
--- a/bitbake/lib/bb/cookerdata.py
+++ b/bitbake/lib/bb/cookerdata.py
@@ -177,14 +177,21 @@ def _inherit(bbclass, data):
bb.parse.BBHandler.inherit(bbclass, "configuration INHERITs", 0, data)
return data
-def findConfigFile(configfile):
+def findConfigFile(configfile, data):
+ search = []
+ bbpath = data.getVar("BBPATH", True)
+ if bbpath:
+ for i in bbpath.split(":"):
+ search.append(os.path.join(i, "conf", configfile))
path = os.getcwd()
while path != "/":
- confpath = os.path.join(path, "conf", configfile)
- if os.path.exists(confpath):
- return confpath
-
+ search.append(os.path.join(path, "conf", configfile))
path, _ = os.path.split(path)
+
+ for i in search:
+ if os.path.exists(i):
+ return i
+
return None
class CookerDataBuilder(object):
@@ -225,8 +232,8 @@ class CookerDataBuilder(object):
logger.exception("Error parsing configuration files")
sys.exit(1)
- def _findLayerConf(self):
- return findConfigFile("bblayers.conf")
+ def _findLayerConf(self, data):
+ return findConfigFile("bblayers.conf", data)
def parseConfigurationFiles(self, prefiles, postfiles):
data = self.data
@@ -236,7 +243,7 @@ class CookerDataBuilder(object):
for f in prefiles:
data = parse_config_file(f, data)
- layerconf = self._findLayerConf()
+ layerconf = self._findLayerConf(data)
if layerconf:
parselog.debug(2, "Found bblayers.conf (%s)", layerconf)
# By definition bblayers.conf is in conf/ of TOPDIR.
reply other threads:[~2013-08-29 13:27 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1377782849.1059.1.camel@ted \
--to=richard.purdie@linuxfoundation.org \
--cc=bitbake-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 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.