#!/bin/bash

echo "num of params is $#"
if [ $# -eq 1 ] ; then
	if [ -d $1 ] ; then
		RPMDIR=$1
	else
        	echo "Directory $1 does not exit"
		exit 1	
	fi
else
        RPMDIR="SRPMS"	
fi
cd $RPMDIR
RPMLIST=`echo *src.rpm`
cd ..

for RPM in $RPMLIST
do
	if [ -f done.$RPMDIR/$RPM ] ; then
	   echo "Skipping $RPM as it was already done"
           rm $RPMDIR/$RPM
	fi  
done
