utils/checkpackagelib/lib_mk.py: check DEPENDENCIES
Check that {FOO}_DEPENDENCIES are never overriden in a conditional Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> Reviewed-by: Ricardo Martincoski <ricardo.martincoski@gmail.com> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
This commit is contained in:
parent
cc570eff96
commit
4910a175b3
@ -88,6 +88,8 @@ class OverriddenVariable(_CheckFunction):
|
||||
r"_SITE\s*=\s*",
|
||||
r"_SOURCE\s*=\s*",
|
||||
r"_VERSION\s*=\s*"])))
|
||||
FORBIDDEN_OVERRIDDEN = re.compile(r"^[A-Z0-9_]+({})".format("|".join([
|
||||
r"_DEPENDENCIES\s*=\s*"])))
|
||||
|
||||
def before(self):
|
||||
self.conditional = 0
|
||||
@ -123,6 +125,10 @@ class OverriddenVariable(_CheckFunction):
|
||||
.format(self.filename, lineno, variable),
|
||||
text]
|
||||
else:
|
||||
if self.FORBIDDEN_OVERRIDDEN.search(text):
|
||||
return ["{}:{}: conditional override of variable {}"
|
||||
.format(self.filename, lineno, variable),
|
||||
text]
|
||||
if variable not in self.unconditionally_set:
|
||||
self.conditionally_set.append(variable)
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user