Re: [PATCH] More fixes

Paul Gortmaker (
Mon, 08 Jan 2001 09:49:47 -0500 also has help text for some 35 CONFIG_xxxx options that
have since been removed from the files. Here is a little
script to prune out those orphan entries (it is only 1/10th the size
of the resulting diff, and its the gift that keeps on giving....)

It tells you how many CONFIG options exist that don't yet have help text
as an added bonus bit of trivia.


--------------------8<-----cut here------8<---------------------
# Check Documentation/ - define_bool/int entries aren't seen
# by the end user and don't need help entries. Create ed script to prune out
# orphans and execute it. Paul Gortmaker 01/2001.

if [ ! -r Documentation/ ]; then
echo Cant read or find Documentation/

echo -ne '\nTotal number of orphan config help entries: '
FILES=`find . -name [cC]`

grep '^CONFIG_[0-9A-Za-z_]' Documentation/|\

# Tab and space inside [ ]
cat $FILES|grep -v define_| \
sed 's/.*[ ]\(CONFIG_[A-Za-z0-9_]\+\)[ ]*.*$/\1/;t;d'|\

diff -u /tmp/tmp-opt.$$ /tmp/tmp-help.$$|\
grep '^\+CONFIG_'|sed 's/^\+//'>/tmp/tmp-orph.$$

OCOUNT=`wc -l < /tmp/tmp-orph.$$`
echo $OCOUNT

echo -ne '\nTotal number of config options without any help text: '
diff -u /tmp/tmp-help.$$ /tmp/tmp-opt.$$|grep '^\+'|wc -l

if [ $OCOUNT -eq 0 ];then
exit 0

echo -ne '\nCopy originial: '
mv -vf Documentation/ Documentation/

echo "ed -s Documentation/<<EOF">/tmp/tmp-ed.$$
for i in `cat /tmp/tmp-orph.$$`
echo "/$i/;-kz">>/tmp/tmp-ed.$$
echo "'z,/^[A-Za-z0-9#]/-d">>/tmp/tmp-ed.$$
echo wq Documentation/>>/tmp/tmp-ed.$$
echo EOF>>/tmp/tmp-ed.$$

echo -ne \\nUnleashing ed\(1\) on orphans in
. /tmp/tmp-ed.$$
echo -e done.\\n

# rm -f /tmp/tmp-opt.$$ /tmp/tmp-help.$$ /tmp/tmp-orph.$$ /tmp/tmp-ed.$$
--------------------8<-----cut here------8<---------------------

Do You Yahoo!?
Get your free address at

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at