Skip to contentSkip to conversation

utils/checkpackagelib/lib_mk.py: check DEPENDENCIES

PATCH Applied Fabrice Fontaine 3 participants 3 messages Nov 10, 2021 – Dec 10, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 utils/checkpackagelib/lib_mk.py: check DEPENDENCIES

Check that {FOO}_DEPENDENCIES are never overriden in a conditional

---
 utils/checkpackagelib/lib_mk.py | 6 ++++++
 1 file changed, 6 insertions(+)
utils/checkpackagelib/lib_mk.py +6 -0
index 0278354434..d09922f724 100644
@@ -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
Signature · 6 lines
2.33.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Fabrice Fontaine

from: Fabrice Fontaine <[email protected]>
date: Wed, Nov 10 06:52 PM +01:00 2021
to: [email protected]
cc: Ricardo Martincoski <[email protected]>, Fabrice Fontaine <[email protected]>
subject: [PATCH 1/1] utils/checkpackagelib/lib_mk.py: check DEPENDENCIES

Check that {FOO}_DEPENDENCIES are never overriden in a conditional

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#2 lore raw
In reply to Fabrice Fontaine
Quoted 3 lines · Fabrice Fontaine

Check that {FOO}_DEPENDENCIES are never overriden in a conditional

Applied to master, thanks.

Regards,
Arnout

Quoted 19 lines
---
  utils/checkpackagelib/lib_mk.py | 6 ++++++
  1 file changed, 6 insertions(+)
utils/checkpackagelib/lib_mk.py +2 -0
index 0278354434..d09922f724 100644
@@ -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

utils/checkpackagelib/lib_mk.py class OverriddenVariable(_CheckFunction): · line 134

Quoted 10 lines
utils/checkpackagelib/lib_mk.py +4 -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

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot