. $MYPWD/../locations.include
TREE=$1
if [ ! -d $1 ]; then
    echo "First parameter must be the directory to place at the root of the CD"
    exit 1
fi

DEST=$2
if [ -z "$2" ]; then
    echo "Second parameter must be the name of the final iso image."
    exit 1
fi

echo "Creating $2 from $1..."

cd $TREE

mkisofs \
	-A "$VERSION DISC4" \
	-V "$VERSION" \
	-R -l -v -J \
	-x ./lost+found \
	-o $DEST \
        -graft-points \
	 . \
      notsupported/=$RELEASEDIR/$ARCH/notsupported/RPMS \
      contrib/=$RELEASEDIR/$ARCH/contrib/RPMS 
