summaryrefslogtreecommitdiffstats
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 16:16:02 +0100
commit00c8834293b84a9fa1616de7aace639fc93a81e0 (patch)
tree409942690d8765e2360f29c54c2560619c604e74
parentfbf64380f42aeb3dbedcf66b11b87a52aecf0719 (diff)
downloadpoky-00c8834293b84a9fa1616de7aace639fc93a81e0.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. (From OE-Core rev: aa4991c307d4bbdd06c3cbf8448240b74c5e01c4) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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):
224 224
225 if not os.path.exists(sstatepkg): 225 if not os.path.exists(sstatepkg):
226 pstaging_fetch(sstatefetch, sstatepkg, d) 226 pstaging_fetch(sstatefetch, sstatepkg, d)
227 if not os.path.exists(sstatepkg + ".siginfo"):
228 pstaging_fetch(sstatefetch + ".siginfo", sstatepkg + ".siginfo", d)
229 227
230 if not os.path.isfile(sstatepkg): 228 if not os.path.isfile(sstatepkg):
231 bb.note("Staging package %s does not exist" % sstatepkg) 229 bb.note("Staging package %s does not exist" % sstatepkg)
@@ -504,30 +502,30 @@ def pstaging_fetch(sstatefetch, sstatepkg, d):
504 bb.data.update_data(localdata) 502 bb.data.update_data(localdata)
505 503
506 dldir = localdata.expand("${SSTATE_DIR}") 504 dldir = localdata.expand("${SSTATE_DIR}")
507 srcuri = "file://" + sstatefetch
508
509 bb.mkdirhier(dldir) 505 bb.mkdirhier(dldir)
510 506
511 localdata.delVar('MIRRORS') 507 localdata.delVar('MIRRORS')
512 localdata.delVar('FILESPATH') 508 localdata.delVar('FILESPATH')
513 localdata.setVar('DL_DIR', dldir) 509 localdata.setVar('DL_DIR', dldir)
514 localdata.setVar('PREMIRRORS', mirrors) 510 localdata.setVar('PREMIRRORS', mirrors)
515 localdata.setVar('SRC_URI', srcuri)
516 511
517 # Try a fetch from the sstate mirror, if it fails just return and 512 # Try a fetch from the sstate mirror, if it fails just return and
518 # we will build the package 513 # we will build the package
519 try: 514 for srcuri in ['file://{0}'.format(sstatefetch),
520 fetcher = bb.fetch2.Fetch([srcuri], localdata, cache=False) 515 'file://{0}.siginfo'.format(sstatefetch)]:
521 fetcher.download() 516 localdata.setVar('SRC_URI', srcuri)
522 517 try:
523 # Need to optimise this, if using file:// urls, the fetcher just changes the local path 518 fetcher = bb.fetch2.Fetch([srcuri], localdata, cache=False)
524 # For now work around by symlinking 519 fetcher.download()
525 localpath = bb.data.expand(fetcher.localpath(srcuri), localdata) 520
526 if localpath != sstatepkg and os.path.exists(localpath) and not os.path.exists(sstatepkg): 521 # Need to optimise this, if using file:// urls, the fetcher just changes the local path
527 os.symlink(localpath, sstatepkg) 522 # For now work around by symlinking
528 523 localpath = bb.data.expand(fetcher.localpath(srcuri), localdata)
529 except bb.fetch2.BBFetchException: 524 if localpath != sstatepkg and os.path.exists(localpath) and not os.path.exists(sstatepkg):
530 pass 525 os.symlink(localpath, sstatepkg)
526
527 except bb.fetch2.BBFetchException:
528 break
531 529
532def sstate_setscene(d): 530def sstate_setscene(d):
533 shared_state = sstate_state_fromvars(d) 531 shared_state = sstate_state_fromvars(d)