#!/bin/bash
# 
# Install package using yum
#

TYPE=package
. `dirname $0`/xsync_functions
xsync_setup $*

V='-e0 -d0'
if [ "$VERBOSE" = 1 ]; then
  V='-e1 -d2'
fi

pkglist=
for i in $DIR/$ME.d/*; do
  i=`basename $i`
  # Test for conflicts
  xsync_conflicts $i
  # Test for bogus packages
# yum list $i | egrep -q "^$i "
# if [ $? -ne 0 ]; then
#   test $QUIET || echo "WARNING: invalid package $i in $DIR/$ME.d"
#   continue
# fi
  # Add to pkglist
  pkglist="$pkglist $i"
done

# Do install
if [ -n "$pkglist" ]; then
  CMD="yum -t -y $V install $pkglist"
  if [ "$ECHO" ]; then
    echo $CMD
  else
    $CMD
  fi
fi

