From 94ff843006fede275148a545e7011f21bf6c73cb Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Wed, 6 Mar 2013 18:00:30 +0000 Subject: 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 --- layerindex/update.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'layerindex/update.py') diff --git a/layerindex/update.py b/layerindex/update.py index 8df34d9c26..f4bda9825c 100755 --- a/layerindex/update.py +++ b/layerindex/update.py @@ -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): -- cgit 1.2.3-korg