[oe-commits] [openembedded-core] 01/04: classes/image: don't chdir when creating symlinks

git at git.openembedded.org git at git.openembedded.org
Wed Jun 15 17:11:28 UTC 2016


rpurdie pushed a commit to branch master
in repository openembedded-core.

commit 2fdf06fbe986d742f6bb13e9348b50e9aab03139
Author: Ross Burton <ross.burton at intel.com>
AuthorDate: Mon Jun 13 20:05:18 2016 +0100

    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 <ross.burton at intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/classes/image.bbclass | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 2577cca..61295f4 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 \

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list