6260N/A#!/bin/sh
6260N/A
6260N/A# $Id$
6260N/A#
6260N/A# Search for files in cvs that are not referenced in spec files.
6260N/A# Depending on command line switch, script searches for:
6260N/A# - patches not referenced in any spec file
6260N/A# - ext-sources not referenced in any spec file
6260N/A# - Linux spec files not mentioned in any Solaris spec file.
6260N/A#
6260N/A
6260N/A
6260N/A# Display usage if no arguments on command line.
6260N/Aif [ $# -eq 0 ]
6260N/Athen
6260N/A cat << END_OF_USAGE
6260N/AUsage: `basename $0` [-patches|-ext-sources|-linux-only]
6260N/A
6260N/A-patches list patches not referenced in any spec file.
6260N/A-ext-sources list ext-sources files not referenced in any spec file
6260N/A-linux-only list Linux spec files not mentioned in any Solaris spec file.
6260N/AEND_OF_USAGE
6260N/A exit 1
6260N/Afi
6260N/A
6260N/A
6265N/A# Determine the script directory.
6265N/AScriptDir=`dirname $0` # Get potentially relative script directory.
6265N/AScriptDir=`( cd $ScriptDir; pwd )` # Get absolute directory.
6265N/A
6265N/A# Go to the spec-files directory and ensure other dirs present.
6265N/Acd $ScriptDir/..
10143N/Aif [ ! -d patches -o ! -d base-specs -o ! -d closed -o ! -d ext-sources ]
6260N/Athen
6265N/A echo "ERROR: Expected directory structure not present. Contact gnome-re@sun.com."
6260N/A exit 1
6260N/Afi
6260N/A
6260N/A
6260N/Acase "$1" in
10143N/A # Search for '^Patch.*' in Solaris, base and closed spec files.
6260N/A -patches|-p*)
10143N/A for d in patches
6260N/A do
6260N/A for f in `cd $d; ls *.diff`
6260N/A do
10143N/A found=`grep "^Patch.*$f" *.spec base-specs/*.spec closed/*.spec`
6260N/A if [ -z "$found" ]
6260N/A then
6260N/A echo $d/$f
6260N/A fi
6260N/A done
6260N/A done ;;
6260N/A
6260N/A # Search '^Source' in all spec files, '^SUNW_Copyright' in Solaris spec
6260N/A # files and then '^%.class' (rclass and iclass) in Solaris spec files.
6260N/A -ext-sources|-e*)
6260N/A for f in `cd ext-sources; ls`
6260N/A do
6260N/A if [ -f ext-sources/$f ]
6260N/A then
10143N/A found=`grep "^Source.*$f" *.spec base-specs/*.spec closed/*.spec`
6260N/A if [ -z "$found" ]
6260N/A then
10143N/A found=`grep "^SUNW_Copyright.*$f" *.spec closed/*.spec`
6260N/A if [ -z "$found" ]
6260N/A then
10143N/A found=`grep "^%.class.*$f" *.spec closed/*.spec`
6260N/A if [ -z "$found" ]
6260N/A then
6260N/A echo $f
6260N/A fi
6260N/A fi
6260N/A fi
6260N/A fi
6260N/A done ;;
6260N/A
6260N/A # Search for '^%use.*' in Solaris spec files.
6260N/A -linux-only|-l*)
6260N/A for f in *.spec
6260N/A do
10143N/A found=`grep "^%use.*$f" *.spec closed/*.spec`
6260N/A if [ -z "$found" ]
6260N/A then
6260N/A echo $f
6260N/A fi
6260N/A done ;;
6260N/Aesac
6260N/A