aboutsummaryrefslogtreecommitdiffstats
path: root/configure.py
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2021-01-23 07:54:03 -0500
committerJack Lloyd <[email protected]>2021-01-23 07:54:03 -0500
commit2bc84427cecb49e75b69a29f28e8e72a6b12d6f7 (patch)
tree1f85640b26019597246b74daa08eda18fe6498a9 /configure.py
parentef11b8dddd4b7bfd5bd0101e969c2b947ed5d586 (diff)
Restrict target os features to match [a-z][a-z0-9_]*[a-z0-9]
Diffstat (limited to 'configure.py')
-rwxr-xr-xconfigure.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/configure.py b/configure.py
index bb0016d5c..2100ba764 100755
--- a/configure.py
+++ b/configure.py
@@ -1554,6 +1554,15 @@ class OsInfo(InfoObject): # pylint: disable=too-many-instance-attributes
self.uses_pkg_config = (lex.uses_pkg_config == 'yes')
self.feature_macros = lex.feature_macros
+ self._validate_os_features(self.target_features, infofile)
+
+ @staticmethod
+ def _validate_os_features(features, infofile):
+ feature_re = re.compile('^[a-z][a-z0-9_]*[a-z0-9]$')
+ for feature in features:
+ if not feature_re.match(feature):
+ logging.error("Invalid OS feature %s in %s" % (feature, infofile))
+
def matches_name(self, nm):
if nm in self._aliases:
return True