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:33:18 -0800 |
commit | 41bc192c0b5795561b239872008c91a867732219 (patch) | |
tree | a21feb51bde721ba553296676ce4b5ea2662bf37 /meta/classes/recipe_sanity.bbclass | |
parent | 3b57de68e70e77dbc03c0616a83a29a2e99e40b4 (diff) | |
download | openembedded-core-41bc192c0b5795561b239872008c91a867732219.tar.gz openembedded-core-41bc192c0b5795561b239872008c91a867732219.tar.bz2 openembedded-core-41bc192c0b5795561b239872008c91a867732219.tar.xz openembedded-core-41bc192c0b5795561b239872008c91a867732219.zip |
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/recipe_sanity.bbclass')
-rw-r--r-- | meta/classes/recipe_sanity.bbclass | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/meta/classes/recipe_sanity.bbclass b/meta/classes/recipe_sanity.bbclass index bb60ffa00..b3246599b 100644 --- a/meta/classes/recipe_sanity.bbclass +++ b/meta/classes/recipe_sanity.bbclass @@ -1,5 +1,5 @@ def __note(msg, d): - bb.note("%s: recipe_sanity: %s" % (d.getVar("P", 1), msg)) + bb.note("%s: recipe_sanity: %s" % (d.getVar("P", True), msg)) __recipe_sanity_badruntimevars = "RDEPENDS RPROVIDES RRECOMMENDS RCONFLICTS" def bad_runtime_vars(cfgdata, d): @@ -7,7 +7,7 @@ def bad_runtime_vars(cfgdata, d): bb.data.inherits_class("cross", d): return - for var in d.getVar("__recipe_sanity_badruntimevars", 1).split(): + for var in d.getVar("__recipe_sanity_badruntimevars", True).split(): val = d.getVar(var, 0) if val and val != cfgdata.get(var): __note("%s should be %s_${PN}" % (var, var), d) @@ -15,17 +15,17 @@ def bad_runtime_vars(cfgdata, d): __recipe_sanity_reqvars = "DESCRIPTION" __recipe_sanity_reqdiffvars = "LICENSE" def req_vars(cfgdata, d): - for var in d.getVar("__recipe_sanity_reqvars", 1).split(): + for var in d.getVar("__recipe_sanity_reqvars", True).split(): if not d.getVar(var, 0): __note("%s should be set" % var, d) - for var in d.getVar("__recipe_sanity_reqdiffvars", 1).split(): + for var in d.getVar("__recipe_sanity_reqdiffvars", True).split(): val = d.getVar(var, 0) cfgval = cfgdata.get(var) # Hardcoding is bad, but I'm lazy. We don't care about license being # unset if the recipe has no sources! - if var == "LICENSE" and d.getVar("SRC_URI", 1) == cfgdata.get("SRC_URI"): + if var == "LICENSE" and d.getVar("SRC_URI", True) == cfgdata.get("SRC_URI"): continue if not val: @@ -43,11 +43,11 @@ def var_renames_overwrite(cfgdata, d): def incorrect_nonempty_PACKAGES(cfgdata, d): if bb.data.inherits_class("native", d) or \ bb.data.inherits_class("cross", d): - if d.getVar("PACKAGES", 1): + if d.getVar("PACKAGES", True): return True def can_use_autotools_base(cfgdata, d): - cfg = d.getVar("do_configure", 1) + cfg = d.getVar("do_configure", True) if not bb.data.inherits_class("autotools", d): return False @@ -65,10 +65,10 @@ def can_use_autotools_base(cfgdata, d): def can_remove_FILESPATH(cfgdata, d): expected = cfgdata.get("FILESPATH") - #expected = "${@':'.join([os.path.normpath(os.path.join(fp, p, o)) for fp in d.getVar('FILESPATHBASE', 1).split(':') for p in d.getVar('FILESPATHPKG', 1).split(':') for o in (d.getVar('OVERRIDES', 1) + ':').split(':') if os.path.exists(os.path.join(fp, p, o))])}:${FILESDIR}" + #expected = "${@':'.join([os.path.normpath(os.path.join(fp, p, o)) for fp in d.getVar('FILESPATHBASE', True).split(':') for p in d.getVar('FILESPATHPKG', True).split(':') for o in (d.getVar('OVERRIDES', True) + ':').split(':') if os.path.exists(os.path.join(fp, p, o))])}:${FILESDIR}" expectedpaths = bb.data.expand(expected, d) unexpanded = d.getVar("FILESPATH", 0) - filespath = d.getVar("FILESPATH", 1).split(":") + filespath = d.getVar("FILESPATH", True).split(":") filespath = [os.path.normpath(f) for f in filespath if os.path.exists(f)] for fp in filespath: if not fp in expectedpaths: @@ -79,13 +79,13 @@ def can_remove_FILESPATH(cfgdata, d): def can_remove_FILESDIR(cfgdata, d): expected = cfgdata.get("FILESDIR") - #expected = "${@bb.which(d.getVar('FILESPATH', 1), '.')}" + #expected = "${@bb.which(d.getVar('FILESPATH', True), '.')}" unexpanded = d.getVar("FILESDIR", 0) if unexpanded is None: return False - expanded = os.path.normpath(d.getVar("FILESDIR", 1)) - filespath = d.getVar("FILESPATH", 1).split(":") + expanded = os.path.normpath(d.getVar("FILESDIR", True)) + filespath = d.getVar("FILESPATH", True).split(":") filespath = [os.path.normpath(f) for f in filespath if os.path.exists(f)] return unexpanded != expected and \ @@ -103,7 +103,7 @@ def can_remove_others(p, cfgdata, d): continue try: - expanded = d.getVar(k, 1) + expanded = d.getVar(k, True) cfgexpanded = bb.data.expand(cfgunexpanded, d) except bb.fetch.ParameterError: continue @@ -115,8 +115,8 @@ def can_remove_others(p, cfgdata, d): (p, cfgunexpanded, unexpanded, expanded)) python do_recipe_sanity () { - p = d.getVar("P", 1) - p = "%s %s %s" % (d.getVar("PN", 1), d.getVar("PV", 1), d.getVar("PR", 1)) + p = d.getVar("P", True) + p = "%s %s %s" % (d.getVar("PN", True), d.getVar("PV", True), d.getVar("PR", True)) sanitychecks = [ (can_remove_FILESDIR, "candidate for removal of FILESDIR"), |