mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 12:59:02 +02:00
sstate: apply proper umask when fetching from SSTATE_MIRROR
Currently, files and directories created under ${SSTATE_DIR} when fetching from an sstate mirror are not created with group write, unlike when the sstate artifacts are generated locally. That's inconsistent, and problematic when the local sstate dir is shared among multiple users. Wrap the fetching in a bb.utils.umask() context manager, and for simplicity move the mkdir of SSTATE_DIR inside that. (From OE-Core rev: a6038553aaef3b88b834a09018c524c4fa41e625) Signed-off-by: Rasmus Villemoes <ravi@prevas.dk> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
24cab297ed
commit
ba290e7ec8
|
@ -726,7 +726,6 @@ def pstaging_fetch(sstatefetch, d):
|
||||||
localdata = bb.data.createCopy(d)
|
localdata = bb.data.createCopy(d)
|
||||||
|
|
||||||
dldir = localdata.expand("${SSTATE_DIR}")
|
dldir = localdata.expand("${SSTATE_DIR}")
|
||||||
bb.utils.mkdirhier(dldir)
|
|
||||||
|
|
||||||
localdata.delVar('MIRRORS')
|
localdata.delVar('MIRRORS')
|
||||||
localdata.setVar('FILESPATH', dldir)
|
localdata.setVar('FILESPATH', dldir)
|
||||||
|
@ -746,16 +745,19 @@ def pstaging_fetch(sstatefetch, d):
|
||||||
if bb.utils.to_boolean(d.getVar("SSTATE_VERIFY_SIG"), False):
|
if bb.utils.to_boolean(d.getVar("SSTATE_VERIFY_SIG"), False):
|
||||||
uris += ['file://{0}.sig;downloadfilename={0}.sig'.format(sstatefetch)]
|
uris += ['file://{0}.sig;downloadfilename={0}.sig'.format(sstatefetch)]
|
||||||
|
|
||||||
for srcuri in uris:
|
with bb.utils.umask(0o002):
|
||||||
localdata.delVar('SRC_URI')
|
bb.utils.mkdirhier(dldir)
|
||||||
localdata.setVar('SRC_URI', srcuri)
|
|
||||||
try:
|
|
||||||
fetcher = bb.fetch2.Fetch([srcuri], localdata, cache=False)
|
|
||||||
fetcher.checkstatus()
|
|
||||||
fetcher.download()
|
|
||||||
|
|
||||||
except bb.fetch2.BBFetchException:
|
for srcuri in uris:
|
||||||
pass
|
localdata.delVar('SRC_URI')
|
||||||
|
localdata.setVar('SRC_URI', srcuri)
|
||||||
|
try:
|
||||||
|
fetcher = bb.fetch2.Fetch([srcuri], localdata, cache=False)
|
||||||
|
fetcher.checkstatus()
|
||||||
|
fetcher.download()
|
||||||
|
|
||||||
|
except bb.fetch2.BBFetchException:
|
||||||
|
pass
|
||||||
|
|
||||||
def sstate_setscene(d):
|
def sstate_setscene(d):
|
||||||
shared_state = sstate_state_fromvars(d)
|
shared_state = sstate_state_fromvars(d)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user