diff options
| author | Richard Purdie <rpurdie@linux.intel.com> | 2010-10-22 14:27:44 +0100 |
|---|---|---|
| committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-10-22 14:48:54 +0100 |
| commit | 3f599b3f6a47286277cdaa8503f8a8da024eadd4 (patch) | |
| tree | 6121cabb6d9be63a8acf9912f043093209e58db8 /meta/classes/sstate.bbclass | |
| parent | eef1d813b7248ba40eb958f4052dbe4d52b93591 (diff) | |
| download | poky-3f599b3f6a47286277cdaa8503f8a8da024eadd4.tar.gz | |
sstate: Fix mirror handling for file:// urls
The fetcher has special handling for file:// mirror urls, being efficient and
just providing an updated path. Unfortunately the sstate fetching code wasn't
able to handle this. This patch detects this and injects a symlink to ensure
everything works. It also fixes some datastore references to be correct and
ensures the sstate download directory exists if it doesn't already.
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta/classes/sstate.bbclass')
| -rw-r--r-- | meta/classes/sstate.bbclass | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass index fb30a18b72..3674a79060 100644 --- a/meta/classes/sstate.bbclass +++ b/meta/classes/sstate.bbclass | |||
| @@ -278,6 +278,9 @@ def pstaging_fetch(sstatepkg, d): | |||
| 278 | 278 | ||
| 279 | dldir = bb.data.expand("${SSTATE_DIR}", localdata) | 279 | dldir = bb.data.expand("${SSTATE_DIR}", localdata) |
| 280 | srcuri = "file://" + os.path.basename(sstatepkg) | 280 | srcuri = "file://" + os.path.basename(sstatepkg) |
| 281 | |||
| 282 | bb.mkdirhier(dldir) | ||
| 283 | |||
| 281 | bb.data.setVar('DL_DIR', dldir, localdata) | 284 | bb.data.setVar('DL_DIR', dldir, localdata) |
| 282 | bb.data.setVar('PREMIRRORS', mirrors, localdata) | 285 | bb.data.setVar('PREMIRRORS', mirrors, localdata) |
| 283 | bb.data.setVar('SRC_URI', srcuri, localdata) | 286 | bb.data.setVar('SRC_URI', srcuri, localdata) |
| @@ -285,8 +288,12 @@ def pstaging_fetch(sstatepkg, d): | |||
| 285 | # Try a fetch from the sstate mirror, if it fails just return and | 288 | # Try a fetch from the sstate mirror, if it fails just return and |
| 286 | # we will build the package | 289 | # we will build the package |
| 287 | try: | 290 | try: |
| 288 | bb.fetch.init([srcuri], pd) | 291 | bb.fetch.init([srcuri], localdata) |
| 289 | bb.fetch.go(pd, [srcuri]) | 292 | bb.fetch.go(localdata, [srcuri]) |
| 293 | # Need to optimise this, if using file:// urls, the fetcher just changes the local path | ||
| 294 | # For now work around by symlinking | ||
| 295 | if bb.data.expand(bb.fetch.localpath(srcuri, localdata), localdata) != sstatepkg: | ||
| 296 | os.symlink(bb.data.expand(bb.fetch.localpath(srcuri, localdata), localdata), sstatepkg) | ||
| 290 | except: | 297 | except: |
| 291 | pass | 298 | pass |
| 292 | 299 | ||
| @@ -377,10 +384,10 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d): | |||
| 377 | 384 | ||
| 378 | srcuri = "file://" + os.path.basename(sstatefile) | 385 | srcuri = "file://" + os.path.basename(sstatefile) |
| 379 | bb.data.setVar('SRC_URI', srcuri, localdata) | 386 | bb.data.setVar('SRC_URI', srcuri, localdata) |
| 380 | bb.note(str(srcuri)) | 387 | #bb.note(str(srcuri)) |
| 381 | 388 | ||
| 382 | try: | 389 | try: |
| 383 | bb.fetch.init(srcuri.split(), d) | 390 | bb.fetch.init(srcuri.split(), localdata) |
| 384 | bb.fetch.checkstatus(localdata) | 391 | bb.fetch.checkstatus(localdata) |
| 385 | ret.append(task) | 392 | ret.append(task) |
| 386 | except: | 393 | except: |
