diff --git a/dist/tools/buildsystem_sanity_check/check.sh b/dist/tools/buildsystem_sanity_check/check.sh index 551b131793aa..6349bb130749 100755 --- a/dist/tools/buildsystem_sanity_check/check.sh +++ b/dist/tools/buildsystem_sanity_check/check.sh @@ -108,6 +108,24 @@ check_not_exporting_variables() { fi } +# Deprecated variables or patterns +# Prevent deprecated varibles or patterns to re-appear after cleanup +check_deprecated_vars_patterns() { + local patterns=() + local pathspec=() + + patterns+=(-e 'FEATURES_MCU_GROUP') + + # Pathspec with exclude should start by an inclusive pathspec in git 2.7.4 + pathspec+=('*') + + # Ignore this file when matching as it self matches + pathspec+=(":!${SCRIPT_PATH}") + + git -C "${RIOTBASE}" grep "${patterns[@]}" -- "${pathspec[@]}" \ + | error_with_message 'Deprecated variables or patterns:' +} + error_on_input() { grep '' && return 1 @@ -116,10 +134,11 @@ error_on_input() { all_checks() { check_not_parsing_features check_not_exporting_variables + check_deprecated_vars_patterns } main() { - all_checks | prepend 'Invalid build system patterns found by '"${0}:" || error_on_input >&2 + all_checks | prepend 'Invalid build system patterns found by '"${0}:" | error_on_input >&2 exit $? }