check_unused.sh revision 6260
# $Id$
#
# Search for files in cvs that are not referenced in spec files.
# Depending on command line switch, script searches for:
# - patches not referenced in any spec file
# - ext-sources not referenced in any spec file
# - Linux spec files not mentioned in any Solaris spec file.
#
# Display usage if no arguments on command line.
if [ $# -eq 0 ]
then
cat << END_OF_USAGE
Usage: `basename $0` [-patches|-ext-sources|-linux-only]
-patches list patches not referenced in any spec file.
-ext-sources list ext-sources files not referenced in any spec file
-linux-only list Linux spec files not mentioned in any Solaris spec file.
END_OF_USAGE
exit 1
fi
if [ ! -d ../spec-files/patches ]
then
echo "ERROR: Run this script from the spec-files directory."
exit 1
fi
case "$1" in
# Search for '^Patch.*' in Linux, Solaris and extra-specs spec files.
-patches|-p*)
do
do
if [ -z "$found" ]
then
echo $d/$f
fi
done
done ;;
# Search '^Source' in all spec files, '^SUNW_Copyright' in Solaris spec
# files and then '^%.class' (rclass and iclass) in Solaris spec files.
do
then
if [ -z "$found" ]
then
then
if [ -z "$found" ]
then
echo $f
fi
fi
fi
fi
done ;;
# Search for '^%use.*' in Solaris spec files.
do
if [ -z "$found" ]
then
echo $f
fi
done ;;
esac