[gnome-continuous-yocto/gnomeostree-3.28-rocko: 7277/8267] qemuboot.bbclass: Prevent creating a link loop



commit 322985be2367cdbeda6ede9d54f18ddd9b73a4da
Author: Mike Looijmans <mike looijmans topic nl>
Date:   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.
    
    (From OE-Core rev: f46652e77f467861dc68c3a8e54f27d08659222d)
    
    Signed-off-by: Mike Looijmans <mike looijmans topic nl>
    Signed-off-by: Richard Purdie <richard purdie linuxfoundation org>

 meta/classes/qemuboot.bbclass |    7 ++++---
 1 files 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)
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]