[oe-commits] [openembedded-core] 08/22: qemuboot.bbclass: Prevent creating a link loop

git at git.openembedded.org git at git.openembedded.org
Fri Aug 18 09:54:33 UTC 2017


This is an automated email from the git hooks/post-receive script.

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

commit 5b4f9b37049d71b9141adffea5e516366576cd64
Author: Mike Looijmans <mike.looijmans at topic.nl>
AuthorDate: Thu Aug 17 15:43:18 2017 +0200

    qemuboot.bbclass: Prevent creating a link loop
    
    When IMAGE_NAME and IMAGE_LINK_NAME are equal, do_write_qemuboot_conf will
    create a symlink that links to itself.
    
    Check if this is the case before creating the link.
    
    Signed-off-by: Mike Looijmans <mike.looijmans at topic.nl>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/classes/qemuboot.bbclass | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/meta/classes/qemuboot.bbclass b/meta/classes/qemuboot.bbclass
index 86b3060..0e21fc9 100644
--- a/meta/classes/qemuboot.bbclass
+++ b/meta/classes/qemuboot.bbclass
@@ -114,7 +114,8 @@ python do_write_qemuboot_conf() {
     with open(qemuboot, 'w') as f:
         cf.write(f)
 
-    if os.path.lexists(qemuboot_link):
-       os.remove(qemuboot_link)
-    os.symlink(os.path.basename(qemuboot), qemuboot_link)
+    if qemuboot_link != qemuboot:
+        if os.path.lexists(qemuboot_link):
+           os.remove(qemuboot_link)
+        os.symlink(os.path.basename(qemuboot), qemuboot_link)
 }

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


More information about the Openembedded-commits mailing list