]> git.pld-linux.org Git - projects/pld-ftp-admin.git/commitdiff
- remove script
authorMariusz Mazur <mmazur@pld-linux.org>
Tue, 21 Sep 2004 17:19:41 +0000 (17:19 +0000)
committerMariusz Mazur <mmazur@pld-linux.org>
Tue, 21 Sep 2004 17:19:41 +0000 (17:19 +0000)
Changed files:
    bin/remove.sh -> 1.1

bin/remove.sh [new file with mode: 0755]

diff --git a/bin/remove.sh b/bin/remove.sh
new file mode 100755 (executable)
index 0000000..98c378f
--- /dev/null
@@ -0,0 +1,46 @@
+#!/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"
+
This page took 0.073349 seconds and 4 git commands to generate.