--- /dev/null
+#!/bin/sh
+
+. ~/pld-ftp-admin/scripts/functions
+
+#TODO: --removeolder
+
+if [ "$#" -lt "2" ]; then
+ echo "Not enough parameters given"
+ echo "remove.sh tree package1 [package2...]"
+ exit
+fi
+
+if [ ! -d "$FTP_DIR/$1" ]; then
+ echo "$FTP_DIR/$1 does not exit"
+ exit
+fi
+
+# we set $tree and $files
+tree=$1
+files=""
+
+waserror=0
+shift 1
+while test "$#" -gt "0"
+do
+ file=`echo $1|sed -e 's,.src.rpm$,,'`
+ if [ ! -f "$FTP_DIR/$tree/SRPMS/.metadata/$file.src.rpm.info" ]; then
+ waserror=$(($waserror+1))
+ echo "$file was not found in source tree"
+ fi
+ files="$files $file"
+ shift
+done
+
+if [ "$waserror" != "0" ]; then
+ echo "$waserror error(s) encountered... aborting"
+ exit
+fi
+
+# Remove packages older than the ones we're removing
+#olderpkgs=`find_older_pkgs "$from" "$files"`
+#remove_pkgs "$from" "$olderpkgs"
+
+# Remove given packages
+remove_pkgs "$tree" "$files"
+