[bitbake-devel] [PATCH] lib/bb/utils.py: Preserve ownership of symlink

Daisuke Yamane daisuke.yamane at cybertrust.co.jp
Sat Feb 22 06:17:14 UTC 2020


Yocto Bug: https://bugzilla.yoctoproject.org/show_bug.cgi?id=13806

Uncomment lchown() to preserve ownership of symlink.

Signed-off-by: Daisuke Yamane <daisuke.yamane at cybertrust.co.jp>
---
 bitbake/lib/bb/utils.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
index 47805d02cf..5f5767c1da 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/lib/bb/utils.py
@@ -864,7 +864,7 @@ def copyfile(src, dest, newmtime = None, sstat = None):
             if destexists and not stat.S_ISDIR(dstat[stat.ST_MODE]):
                 os.unlink(dest)
             os.symlink(target, dest)
-            #os.lchown(dest,sstat[stat.ST_UID],sstat[stat.ST_GID])
+            os.lchown(dest,sstat[stat.ST_UID],sstat[stat.ST_GID])
             return os.lstat(dest)
         except Exception as e:
             logger.warning("copyfile: failed to create symlink %s to %s (%s)" % (dest, target, e))
-- 
2.17.1



More information about the bitbake-devel mailing list