]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
classes/image: don't chdir when creating symlinks
authorRoss Burton <ross.burton@intel.com>
Mon, 13 Jun 2016 19:05:18 +0000 (20:05 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 15 Jun 2016 17:09:47 +0000 (18:09 +0100)
There's no need to chdir() when creating image symlinks, and using chdir()
changes the state for future tasks.

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/image.bbclass

index 2577cca733140feae36a9c7ecd44103b8d598298..61295f4bd71704e7f71015c8f5a6f9dc06802975 100644 (file)
@@ -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 \