DISTARCH=i386
DEFAULT=HEPL
COMPSFILE=comps.xml.main
WHERE=`pwd`
W1up=`dirname $WHERE`
W2up=`dirname $W1up`
W3up=`dirname $W2up`
BASEDIR=`dirname $W3up`
if [ -f  $WHERE/$COMPSFILE ] ; then
   BASEDIR=$WHERE
else
   if [ -f  $W1up/$COMPSFILE ] ; then
        BASEDIR=$W1up
   else
   	echo "Could not find $COMPSFILE"
	exit
   fi
fi
echo "Going to copy $BASEDIR/comps.xml.main over as comps.xml now, press return if ok"
echo "Saving old comps.xml as oldcomps/comps.xml"
read
cp $BASEDIR/comps.xml $BASEDIR/oldcomps/comps.xml
cp $BASEDIR/comps.xml.main $BASEDIR/comps.xml
if [ -d $BASEDIR/../RPMS/ ] ; then
   cp $BASEDIR/comps.xml $BASEDIR/../RPMS/yumgroups.xml
else
   cp $BASEDIR/comps.xml $BASEDIR/../Updates/yumgroups.xml
fi
echo "Going to make comps.rpm now"
$BASEDIR/scripts/make.comps.rpm.sh
