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/sourcepkg.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/sourcepkg.bbclass')
| -rw-r--r-- | meta/classes/sourcepkg.bbclass | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/meta/classes/sourcepkg.bbclass b/meta/classes/sourcepkg.bbclass index 38edfe4e2e..2a78a90452 100644 --- a/meta/classes/sourcepkg.bbclass +++ b/meta/classes/sourcepkg.bbclass | |||
| @@ -6,7 +6,7 @@ DISTRO ?= "openembedded" | |||
| 6 | 6 | ||
| 7 | def get_src_tree(d): | 7 | def get_src_tree(d): |
| 8 | 8 | ||
| 9 | workdir = d.getVar('WORKDIR', 1) | 9 | workdir = d.getVar('WORKDIR', True) |
| 10 | if not workdir: | 10 | if not workdir: |
| 11 | bb.error("WORKDIR not defined, unable to find source tree.") | 11 | bb.error("WORKDIR not defined, unable to find source tree.") |
| 12 | return | 12 | return |
| @@ -55,8 +55,8 @@ sourcepkg_do_archive_bb() { | |||
| 55 | 55 | ||
| 56 | python sourcepkg_do_dumpdata() { | 56 | python sourcepkg_do_dumpdata() { |
| 57 | 57 | ||
| 58 | workdir = d.getVar('WORKDIR', 1) | 58 | workdir = d.getVar('WORKDIR', True) |
| 59 | distro = d.getVar('DISTRO', 1) | 59 | distro = d.getVar('DISTRO', True) |
| 60 | s_tree = get_src_tree(d) | 60 | s_tree = get_src_tree(d) |
| 61 | openembeddeddir = os.path.join(workdir, s_tree, distro) | 61 | openembeddeddir = os.path.join(workdir, s_tree, distro) |
| 62 | dumpfile = os.path.join(openembeddeddir, bb.data.expand("${P}-${PR}.showdata.dump",d)) | 62 | dumpfile = os.path.join(openembeddeddir, bb.data.expand("${P}-${PR}.showdata.dump",d)) |
| @@ -74,7 +74,7 @@ python sourcepkg_do_dumpdata() { | |||
| 74 | # emit the metadata which isnt valid shell | 74 | # emit the metadata which isnt valid shell |
| 75 | for e in d.keys(): | 75 | for e in d.keys(): |
| 76 | if d.getVarFlag(e, 'python'): | 76 | if d.getVarFlag(e, 'python'): |
| 77 | f.write("\npython %s () {\n%s}\n" % (e, d.getVar(e, 1))) | 77 | f.write("\npython %s () {\n%s}\n" % (e, d.getVar(e, True))) |
| 78 | f.close() | 78 | f.close() |
| 79 | } | 79 | } |
| 80 | 80 | ||
