aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/sstate.bbclass
diff options
context:
space:
mode:
authorChristopher Larson <chris_larson@mentor.com>2013-06-10 13:46:23 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-06-11 15:57:04 +0100
commitaa4991c307d4bbdd06c3cbf8448240b74c5e01c4 (patch)
tree65dc5b0f61d7fe4600daaa3d2e1894f3f0fa1f85 /meta/classes/sstate.bbclass
parent46402b2f5b69004751f6663d435bedae0ad9dab1 (diff)
downloadopenembedded-core-contrib-aa4991c307d4bbdd06c3cbf8448240b74c5e01c4.tar.gz
sstate.bbclass: fetch archive+siginfo in a single pstaging_fetch
This avoids unnecessary duplication of setup. The only visible change in behavior will be the case if siginfo exists and the archive does not, in which case it'll redownload both, but this doesn't seem unresasonable to me, particularly since the archive is downloaded first, making this case particularly unlikely. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/sstate.bbclass')
-rw-r--r--meta/classes/sstate.bbclass32
1 files changed, 15 insertions, 17 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 3aa4371c39..28dc312808 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -224,8 +224,6 @@ def sstate_installpkg(ss, d):
if not os.path.exists(sstatepkg):
pstaging_fetch(sstatefetch, sstatepkg, d)
- if not os.path.exists(sstatepkg + ".siginfo"):
- pstaging_fetch(sstatefetch + ".siginfo", sstatepkg + ".siginfo", d)
if not os.path.isfile(sstatepkg):
bb.note("Staging package %s does not exist" % sstatepkg)
@@ -504,30 +502,30 @@ def pstaging_fetch(sstatefetch, sstatepkg, d):
bb.data.update_data(localdata)
dldir = localdata.expand("${SSTATE_DIR}")
- srcuri = "file://" + sstatefetch
-
bb.mkdirhier(dldir)
localdata.delVar('MIRRORS')
localdata.delVar('FILESPATH')
localdata.setVar('DL_DIR', dldir)
localdata.setVar('PREMIRRORS', mirrors)
- localdata.setVar('SRC_URI', srcuri)
# Try a fetch from the sstate mirror, if it fails just return and
# we will build the package
- try:
- fetcher = bb.fetch2.Fetch([srcuri], localdata, cache=False)
- fetcher.download()
-
- # Need to optimise this, if using file:// urls, the fetcher just changes the local path
- # For now work around by symlinking
- localpath = bb.data.expand(fetcher.localpath(srcuri), localdata)
- if localpath != sstatepkg and os.path.exists(localpath) and not os.path.exists(sstatepkg):
- os.symlink(localpath, sstatepkg)
-
- except bb.fetch2.BBFetchException:
- pass
+ for srcuri in ['file://{0}'.format(sstatefetch),
+ 'file://{0}.siginfo'.format(sstatefetch)]:
+ localdata.setVar('SRC_URI', srcuri)
+ try:
+ fetcher = bb.fetch2.Fetch([srcuri], localdata, cache=False)
+ fetcher.download()
+
+ # Need to optimise this, if using file:// urls, the fetcher just changes the local path
+ # For now work around by symlinking
+ localpath = bb.data.expand(fetcher.localpath(srcuri), localdata)
+ if localpath != sstatepkg and os.path.exists(localpath) and not os.path.exists(sstatepkg):
+ os.symlink(localpath, sstatepkg)
+
+ except bb.fetch2.BBFetchException:
+ break
def sstate_setscene(d):
shared_state = sstate_state_fromvars(d)