DISTARCH=i386
FERMIROOT=.
COMPSFILE=comps.xml.main
COMPEXTRA=/usr/share/comps-extras/
export PYTHONPATH=/usr/lib/anaconda
PARTCOMPS=/tmp/comps.xml.tmp
#cd $FERMIROOT/$DISTARCH/RedHat/base
echo "Taking $FERMIROOT/$COMPSFILE and $FERMIROOT/fermigroups.xml.main and $FERMIROOT/workgroups.xml.main "
echo "Writing it out as $FERMIROOT/comps.xml.new "
# gets rid of the "</comps>" at the end temporatily
cat $COMPSFILE |sed 's!</comps>!!g' > $PARTCOMPS
# adding in the fermi groups such as Fermi Desktop 
if [ -s fermigroups.xml.main ] ; then
  cat fermigroups.xml.main >> $PARTCOMPS
fi
# adding in the workgroups
if [ -s workgroups.xml.main ] ; then
  cat workgroups.xml.main >> $PARTCOMPS
fi
# put the "</comps>" at the end back
echo '</comps>' >> $PARTCOMPS
cp $PARTCOMPS comps.xml.new
#sh $FERMIROOT/scripts/verify.comps.xml.sh
