Friday, 1 June 2007

more bash and subversion ignores

# allow over-ride NORMAL_EXTNS in environment if script being called by a robot.
if [[ $NORMAL_EXTNS == "" ]] ; then
    NORMAL_EXTNS="bash|bat|bmp|c|cc|cfg|cgi|cmd|conf|config|cpp|dll|doc|exp|gif|gnuplot|footer|h|hpp|html|ico|java|jpeg|jpg|pdf|php|pl|png|ppt|py|rc|rc2|sh|txt|vcproj|vsprops|wsdl|xls|xml"
fi


IGNORES=`svn status |grep ^? |egrep -v "\.($NORMAL_EXTNS)$" |sed "s/\?  *//;
  s/\(\.host\.make\.\).*/\1\\\\\*/;
  s/\([^\/][^\/]*\)\.\([^.*\/]*\)$/\\\\\*\.\2/;
  " |sort |uniq`



# get list of extensions under source control
EXTNS=`svn status -v |grep -v ^? |grep "\.[^\s]" |sed "s/.*\.\([^.][^.]*\)$/\1/" |sort |uniq `
# This line is quite useful making content for the NORMAL_EXTNS line above

NOT_IN_NORMAL=""
for ext in $EXTNS ; do
   NOT_IN_NORMAL="$NOT_IN_NORMAL `echo ".$ext" |egrep -v "\.($NORMAL_EXTNS)$"`" ;
done
# remove whitespace
NOT_IN_NORMAL=`echo $NOT_IN_NORMAL`
if [[ $NOT_IN_NORMAL != "" ]] ; then
   echo \# extensions with ignore, but not \"normal\" ignore:
   echo \# consider update of NORMAL_EXTNS= line in `basename $0`
   echo $NOT_IN_NORMAL
fi

No comments: