#!/bin/sh
-. ~/pld-ftp-admin/scripts/config
+. ~/pld-ftp-admin/scripts/functions
+
cd $INCOMING_DIR/SRPMS
for i in *uploadinfo; do
srcname=`cat $i|grep '^file:SRPMS'|cut -d: -f 3`
if [ -f $FTP_DIR/$DEFAULT_TO/SRPMS/.metadata/$srcname.info ]; then
- # TODO: Do something more interesting here
- echo "$srcname.info in $DEFAULT_TO already exists"
+ log "$srcname.info already present in $DEFAULT_TO; newer version removed"
+ rm $srcname
+ rm $i
continue
fi
srcname=`cat $i|grep '^file:SRPMS'|cut -d: -f 3`
if [ ! -f $FTP_DIR/$DEFAULT_TO/SRPMS/.metadata/$srcname.info ]; then
- # TODO: Do something more interesting here
+ # TODO: Do something more interesting here... or not
continue
fi
--- /dev/null
+
+# Read config
+if [ ! -f ~/.ftpadmrc ]; then
+ echo "Config not found"
+ exit
+fi
+
+. ~/.ftpadmrc
+
+# For logging
+scriptname=`basename $0`
+
+# Log a message... useful for debugging
+log() {
+ echo `date "+%F %T"` "[$scriptname]" "--" "$@" >>~/pld-ftp-admin/log
+}
+
+# vi: syntax=sh
#!/bin/sh
-. ~/pld-ftp-admin/scripts/config
+. ~/pld-ftp-admin/scripts/functions
if [ "$#" -lt "3" ]; then
echo "Not enough parameters given"