summaryrefslogtreecommitdiffstats
path: root/meta/classes/sstate.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-10-22 14:27:44 +0100
committerRichard Purdie <rpurdie@linux.intel.com>2010-10-22 14:48:54 +0100
commit3f599b3f6a47286277cdaa8503f8a8da024eadd4 (patch)
tree6121cabb6d9be63a8acf9912f043093209e58db8 /meta/classes/sstate.bbclass
parenteef1d813b7248ba40eb958f4052dbe4d52b93591 (diff)
downloadopenembedded-core-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.bbclass15
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):
dldir = bb.data.expand("${SSTATE_DIR}", localdata)
srcuri = "file://" + os.path.basename(sstatepkg)
+
+ bb.mkdirhier(dldir)
+
bb.data.setVar('DL_DIR', dldir, localdata)
bb.data.setVar('PREMIRRORS', mirrors, localdata)
bb.data.setVar('SRC_URI', srcuri, localdata)
@@ -285,8 +288,12 @@ def pstaging_fetch(sstatepkg, d):
# Try a fetch from the sstate mirror, if it fails just return and
# we will build the package
try:
- bb.fetch.init([srcuri], pd)
- bb.fetch.go(pd, [srcuri])
+ bb.fetch.init([srcuri], localdata)
+ bb.fetch.go(localdata, [srcuri])
+ # Need to optimise this, if using file:// urls, the fetcher just changes the local path
+ # For now work around by symlinking
+ if bb.data.expand(bb.fetch.localpath(srcuri, localdata), localdata) != sstatepkg:
+ os.symlink(bb.data.expand(bb.fetch.localpath(srcuri, localdata), localdata), sstatepkg)
except:
pass
@@ -377,10 +384,10 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d):
srcuri = "file://" + os.path.basename(sstatefile)
bb.data.setVar('SRC_URI', srcuri, localdata)
- bb.note(str(srcuri))
+ #bb.note(str(srcuri))
try:
- bb.fetch.init(srcuri.split(), d)
+ bb.fetch.init(srcuri.split(), localdata)
bb.fetch.checkstatus(localdata)
ret.append(task)
except: