#!/bin/sh # Analyse Documentation/Configure.help # Adopted from a script by Paul Gortmaker 01/2001. # Modified greatly by Steven Cole 03/2001. # # Please note that config options written to ach_orphans may well # be harbingers of coming attractions, having been added to Configure.help # prior to inclusion in a [cC]onfig.in file. # That is why this script does not remove those entries, # as did Paul's, on which this script is based. # Many, however are just old cruft. # # Run this from the top of your tree. # The ach script will make files prefixed with ach_ for easy deletion. if [ ! -r Documentation/Configure.help ]; then echo Cant read or find Documentation/Configure.help exit fi FILES=`find . -name [cC]onfig.in` grep '^CONFIG_[0-9A-Za-z_]' Documentation/Configure.help|\ sort|uniq>ach_unique_help grep '^CONFIG_[0-9A-Za-z_]' Documentation/Configure.help|\ sort>ach_all_help # Tab and space inside [ ] cat $FILES|grep -v "^[ ]*#"| \ sed 's/.*[ ]\(CONFIG_[A-Za-z0-9_]\+\)[ ]*.*$/\1/;t;d'|\ sort|uniq>ach_all_options cat $FILES|grep -v define_|grep -v "^#"| \ sed 's/.*[ ]\(CONFIG_[A-Za-z0-9_]\+\)[ ]*.*$/\1/;t;d'|\ sort|uniq>ach_setable_options diff -u ach_setable_options ach_unique_help|\ grep '^\+CONFIG_'|sed 's/^\+//'>ach_orphans diff -u ach_unique_help ach_setable_options|grep '^\+'|grep CONFIG|sed 's/+//'>ach_no_help diff -u ach_setable_options ach_all_options|grep +CONFIG|sed 's/+//'>ach_derived_options diff -u ach_unique_help ach_all_help|grep +CONFIG|sed 's/+//'|uniq>ach_dup_options echo -ne 'Number of config options (total) : ' cat ach_all_options | wc -l echo -ne 'Number of config options (setable) : ' cat ach_setable_options | wc -l echo -ne 'Number of config options (derived) : ' cat ach_derived_options | wc -l echo -ne 'Number of config options with help text (total) : ' cat ach_all_help | wc -l echo -ne 'Number of config options with help text (unique) : ' cat ach_unique_help | wc -l echo -ne 'Number of config options with duplicated help text : ' cat ach_dup_options | wc -l echo -ne 'Number of config options without any help text : ' cat ach_no_help | wc -l echo -ne 'Number of help entries without valid config options : ' cat ach_orphans | wc -l