update.py: ensure script can be run from any directory

Don't assume the current directory contains our conf/local.conf,
explicitly use the directory above where the script is located.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
Paul Eggleton 2013-03-06 18:00:30 +00:00
parent df76a64d95
commit 94ff843006

View File

@ -268,7 +268,10 @@ def main():
core_layerdir = os.path.join(core_repodir, core_layer.vcs_subdir)
out = runcmd("git checkout origin/%s" % options.branch, core_repodir)
out = runcmd("git clean -f -x", core_repodir)
os.environ['BBPATH'] = str("%s:%s" % (os.path.realpath('.'), core_layerdir))
# The directory above where this script exists should contain our conf/layer.conf,
# so add it to BBPATH along with the core layer directory
confparentdir = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..'))
os.environ['BBPATH'] = str("%s:%s" % (confparentdir, core_layerdir))
# Change into a temporary directory so we don't write the cache and other files to the current dir
if not os.path.exists(settings.TEMP_BASE_DIR):