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