From: Ross Burton Date: Mon, 13 Jun 2016 19:05:18 +0000 (+0100) Subject: classes/image: don't chdir when creating symlinks X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~25311 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2fdf06fbe986d742f6bb13e9348b50e9aab03139;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git classes/image: don't chdir when creating symlinks There's no need to chdir() when creating image symlinks, and using chdir() changes the state for future tasks. Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index 2577cca7331..61295f4bd71 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass @@ -519,14 +519,13 @@ python create_symlinks() { taskname = d.getVar("BB_CURRENTTASK", True) subimages = (d.getVarFlag("do_" + taskname, 'subimages', False) or "").split() imgsuffix = d.getVarFlag("do_" + taskname, 'imgsuffix', True) or d.expand("${IMAGE_NAME_SUFFIX}.") - os.chdir(deploy_dir) if not link_name: return for type in subimages: - dst = deploy_dir + "/" + link_name + "." + type + dst = os.path.join(deploy_dir, link_name + "." + type) src = img_name + imgsuffix + type - if os.path.exists(src): + if os.path.exists(os.path.join(deploy_dir, src)): bb.note("Creating symlink: %s -> %s" % (dst, src)) if os.path.islink(dst): if d.getVar('RM_OLD_IMAGE', True) == "1" and \