[oe-commits] [openembedded-core] 02/23: rootfs-postcommands: handle broken links when writing manifest

git at git.openembedded.org git at git.openembedded.org
Wed Apr 13 23:00:08 UTC 2016


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

commit c3bd6088cea387cd40aa7aa0155dfcb0ef14c31b
Author: Ross Burton <ross.burton at intel.com>
AuthorDate: Wed Apr 13 12:14:23 2016 +0100

    rootfs-postcommands: handle broken links when writing manifest
    
    If the manifest link is broken then os.path.exists() returns False so the link
    isn't removed, resulting in the os.symlink() call failing as the file already
    exists.  Prevent this by using os.path.lexists to check that the symlink itself
    exists, not the target.
    
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 meta/classes/rootfs-postcommands.bbclass | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass
index 56e810f..95d28af 100644
--- a/meta/classes/rootfs-postcommands.bbclass
+++ b/meta/classes/rootfs-postcommands.bbclass
@@ -225,7 +225,7 @@ python write_image_manifest () {
 
     if os.path.exists(manifest_name):
         manifest_link = deploy_dir + "/" + link_name + ".manifest"
-        if os.path.exists(manifest_link):
+        if os.path.lexists(manifest_link):
             if d.getVar('RM_OLD_IMAGE', True) == "1" and \
                     os.path.exists(os.path.realpath(manifest_link)):
                 os.remove(os.path.realpath(manifest_link))
@@ -275,5 +275,3 @@ rootfs_check_host_user_contaminated () {
 rootfs_sysroot_relativelinks () {
 	sysroot-relativelinks.py ${SDK_OUTPUT}/${SDKTARGETSYSROOT}
 }
-
-

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


More information about the Openembedded-commits mailing list