From: Prarit Bhargava <prarit@xxxxxxxxxx> redhat/configs/evaluate_configs: Add find dead configs option Add an option to evaluate_configs to find configs that are no longer referenced in the configs. The "-D" command only find unreferenced configs and there is no guarantee that the resulting changes will result in valid config generation. ie) Additional changes may be required after running the -D command. Add an option to find dead configs. Signed-off-by: Prarit Bhargava <prarit@xxxxxxxxxx> diff --git a/redhat/configs/evaluate_configs b/redhat/configs/evaluate_configs index blahblah..blahblah 100755 --- a/redhat/configs/evaluate_configs +++ b/redhat/configs/evaluate_configs @@ -771,6 +771,53 @@ map_configs_to_array() { #uses CONFIG, configmap, cfgs return 0 } +find_dead_configs() { + echo > .finalconfiglist + echo > .configlist + + (cd ..; make rh-configs) + + awk ' + /is not set/ { + split ($0, a, "#"); + split(a[2], b); + print b[1] ; + } + /=/ { + split ($0, a, "="); + print a[1]; + } + ' *.config | sort -u >> .finalconfiglist + + (cd ..; make fedora-configs) + + awk ' + /is not set/ { + split ($0, a, "#"); + split(a[2], b); + print b[1] ; + } + /=/ { + split ($0, a, "="); + print a[1]; + } + ' *.config | sort -u >> .finalconfiglist + + sort -o .finalconfiglist -u .finalconfiglist +# use comm? + + find ./ -name CONFIG_* | sed 's!.*/!!' | sort -u > .configlist + + echo "These CONFIGS defined in redhat/configs but not the final .configs have been deleted:" + diff -u .finalconfiglist .configlist | grep "^+CONFIG" | sed 's/^+//g' | while read FILENAME + do + echo $FILENAME + find ./ -name $FILENAME | xargs rm -f + done + +#rm -f .configlist .finalconfiglist +} + # # # MAIN @@ -781,7 +828,7 @@ map_configs_to_array() { #uses CONFIG, configmap, cfgs FINDFIXES=false FIXCOMMON=false configs= -while getopts "c:dfhjp:" opt; do +while getopts "c:dDfhjp:" opt; do case ${opt} in c ) configs=$OPTARG @@ -789,6 +836,10 @@ while getopts "c:dfhjp:" opt; do d ) DEBUG=true ;; + D ) + find_dead_configs + exit 0 + ;; f ) # Find fixes per config-variant FINDFIXES=true -- https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1498 _______________________________________________ kernel mailing list -- kernel@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe send an email to kernel-leave@xxxxxxxxxxxxxxxxxxxxxxx Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/kernel@xxxxxxxxxxxxxxxxxxxxxxx Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure