We switched to using os.mkdir with the file creation mode specified as the
second parameter. Python masks this with umask behind the scenes which isn't
what we want, we really want the permissions we specify.
To avoid this we zero the umask beforehand and restore afterwards. Other
solutions are possible but would not perform as well which is why
we're using os.mkdir in the first place.
Martin Jansa deserves the credit for debugging where the problem was.
(From OE-Core rev:
f91226553e39439bfd17ab2b06c56cb8bf41061b)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
seen = []
+ # os.mkdir masks the permissions with umask so we have to unset it first
+ oldumask = os.umask(0)
+
for pkg in package_list:
root = os.path.join(pkgdest, pkg)
bb.utils.mkdirhier(root)
if ret is False or ret == 0:
raise bb.build.FuncFailed("File population failed")
+ os.umask(oldumask)
os.chdir(workdir)
unshipped = []