diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-03-03 10:59:25 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-03-05 10:22:56 -0800 |
commit | 06f2f8ce0a3093973ca54b48f542f8485b666079 (patch) | |
tree | dbcfa5c491eb2e5d237aa539cb7c6e77dc07dd6f /meta/classes/src_distribute.bbclass | |
parent | d01dadfb87cfd2284b3e849d35a35fe5df0239c4 (diff) | |
download | poky-06f2f8ce0a3093973ca54b48f542f8485b666079.tar.gz |
meta: Convert getVar/getVarFlag(xxx, 1) -> (xxx, True)
Using "1" with getVar is bad coding style and "True" is preferred.
This patch is a sed over the meta directory of the form:
sed \
-e 's:\(\.getVar([^,()]*, \)1 *):\1True):g' \
-e 's:\(\.getVarFlag([^,()]*, [^,()]*, \)1 *):\1True):g' \
-i `grep -ril getVar *`
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/src_distribute.bbclass')
-rw-r--r-- | meta/classes/src_distribute.bbclass | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/meta/classes/src_distribute.bbclass b/meta/classes/src_distribute.bbclass index 651e492598..efa2720e23 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 = d.getVar('SRC_DISTRIBUTEDIR', 1) | 6 | sources_dir = d.getVar('SRC_DISTRIBUTEDIR', True) |
7 | src_uri = d.getVar('SRC_URI', 1).split() | 7 | src_uri = d.getVar('SRC_URI', True).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 = d.getVar('LICENSE', 1).replace('&', '|') | 11 | licenses = d.getVar('LICENSE', True).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,7 +20,7 @@ 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 = d.getVar('SRC_DISTRIBUTECOMMAND', 1) | 23 | cmd = d.getVar('SRC_DISTRIBUTECOMMAND', True) |
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) |
@@ -29,9 +29,9 @@ python do_distribute_sources () { | |||
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 | d.setVar('DEST', "%s_%s/" % (d.getVar('PF', 1), dest_dir)) | 32 | d.setVar('DEST', "%s_%s/" % (d.getVar('PF', True), dest_dir)) |
33 | else: | 33 | else: |
34 | d.setVar('DEST', "%s_%s" % (d.getVar('PF', 1), url.basename)) | 34 | d.setVar('DEST', "%s_%s" % (d.getVar('PF', True), url.basename)) |
35 | else: | 35 | else: |
36 | d.setVar('DEST', '') | 36 | d.setVar('DEST', '') |
37 | 37 | ||