summaryrefslogtreecommitdiffstats
path: root/meta/classes/src_distribute.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-11-09 15:00:01 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-11-10 11:51:19 +0000
commitc8dee9b92dfd545852ecac8dc2adfc95ac02e957 (patch)
tree5f1b86954646a0f3bb914407994388a6a4346769 /meta/classes/src_distribute.bbclass
parent5d3860f4a8abb8e95442b04f8b84a333af362fcd (diff)
downloadpoky-c8dee9b92dfd545852ecac8dc2adfc95ac02e957.tar.gz
Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata: sed \ -e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \ -e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \ -e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \ -e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \ -e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \ -e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \ -i `grep -ril bb.data *` (From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/src_distribute.bbclass')
-rw-r--r--meta/classes/src_distribute.bbclass16
1 files changed, 8 insertions, 8 deletions
diff --git a/meta/classes/src_distribute.bbclass b/meta/classes/src_distribute.bbclass
index fbfbdf0094..2069d652a3 100644
--- a/meta/classes/src_distribute.bbclass
+++ b/meta/classes/src_distribute.bbclass
@@ -3,12 +3,12 @@ python do_distribute_sources () {
3 l = bb.data.createCopy(d) 3 l = bb.data.createCopy(d)
4 bb.data.update_data(l) 4 bb.data.update_data(l)
5 5
6 sources_dir = bb.data.getVar('SRC_DISTRIBUTEDIR', d, 1) 6 sources_dir = d.getVar('SRC_DISTRIBUTEDIR', 1)
7 src_uri = bb.data.getVar('SRC_URI', d, 1).split() 7 src_uri = d.getVar('SRC_URI', 1).split()
8 fetcher = bb.fetch2.Fetch(src_uri, d) 8 fetcher = bb.fetch2.Fetch(src_uri, d)
9 ud = fetcher.ud 9 ud = fetcher.ud
10 10
11 licenses = bb.data.getVar('LICENSE', d, 1).replace('&', '|') 11 licenses = d.getVar('LICENSE', 1).replace('&', '|')
12 licenses = licenses.replace('(', '').replace(')', '') 12 licenses = licenses.replace('(', '').replace(')', '')
13 clean_licenses = "" 13 clean_licenses = ""
14 for x in licenses.split(): 14 for x in licenses.split():
@@ -20,20 +20,20 @@ python do_distribute_sources () {
20 20
21 for license in clean_licenses.split('|'): 21 for license in clean_licenses.split('|'):
22 for url in ud.values(): 22 for url in ud.values():
23 cmd = bb.data.getVar('SRC_DISTRIBUTECOMMAND', d, 1) 23 cmd = d.getVar('SRC_DISTRIBUTECOMMAND', 1)
24 if not cmd: 24 if not cmd:
25 raise bb.build.FuncFailed("Unable to distribute sources, SRC_DISTRIBUTECOMMAND not defined") 25 raise bb.build.FuncFailed("Unable to distribute sources, SRC_DISTRIBUTECOMMAND not defined")
26 url.setup_localpath(d) 26 url.setup_localpath(d)
27 bb.data.setVar('SRC', url.localpath, d) 27 d.setVar('SRC', url.localpath)
28 if url.type == 'file': 28 if url.type == 'file':
29 if url.basename == '*': 29 if url.basename == '*':
30 import os.path 30 import os.path
31 dest_dir = os.path.basename(os.path.dirname(os.path.abspath(url.localpath))) 31 dest_dir = os.path.basename(os.path.dirname(os.path.abspath(url.localpath)))
32 bb.data.setVar('DEST', "%s_%s/" % (bb.data.getVar('PF', d, 1), dest_dir), d) 32 bb.data.setVar('DEST', "%s_%s/" % (d.getVar('PF', 1), dest_dir), d)
33 else: 33 else:
34 bb.data.setVar('DEST', "%s_%s" % (bb.data.getVar('PF', d, 1), url.basename), d) 34 bb.data.setVar('DEST', "%s_%s" % (d.getVar('PF', 1), url.basename), d)
35 else: 35 else:
36 bb.data.setVar('DEST', '', d) 36 d.setVar('DEST', '')
37 37
38 bb.data.setVar('SRC_DISTRIBUTEDIR', "%s/%s" % (sources_dir, license), d) 38 bb.data.setVar('SRC_DISTRIBUTEDIR', "%s/%s" % (sources_dir, license), d)
39 bb.build.exec_func('SRC_DISTRIBUTECOMMAND', d) 39 bb.build.exec_func('SRC_DISTRIBUTECOMMAND', d)