]> git.pld-linux.org Git - projects/pld-ftp-admin.git/commitdiff
- older packages removal support
authorMariusz Mazur <mmazur@pld-linux.org>
Tue, 21 Sep 2004 17:38:32 +0000 (17:38 +0000)
committerMariusz Mazur <mmazur@pld-linux.org>
Tue, 21 Sep 2004 17:38:32 +0000 (17:38 +0000)
Changed files:
    bin/remove.sh -> 1.2

bin/remove.sh

index 98c378fb896133f974b8340aaaf65bb1bdbf1f29..3bc39e5218e388e92e938601b247dd1d019013aa 100755 (executable)
@@ -2,11 +2,19 @@
 
 . ~/pld-ftp-admin/scripts/functions
 
-#TODO: --removeolder
+case "$1" in
+       -o | --older )
+       shift
+       REMOVEOLDER=yes
+       ;;
+esac   
 
 if [ "$#" -lt "2" ]; then
        echo "Not enough parameters given"
-       echo "remove.sh tree package1 [package2...]"
+       echo "remove.sh [option] tree package1 [package2...]"
+       echo " "
+       echo "Valid options:"
+       echo "-o, --older         - Also remove older packages"
        exit
 fi
 
@@ -37,9 +45,11 @@ if [ "$waserror" != "0" ]; then
        exit
 fi
 
-# Remove packages older than the ones we're removing
-#olderpkgs=`find_older_pkgs "$from" "$files"`
-#remove_pkgs "$from" "$olderpkgs"
+if [ "$REMOVEOLDER" == "yes" ]; then
+       # Remove packages older than the ones we're removing
+       olderpkgs=`find_older_pkgs "$tree" "$files"`
+       remove_pkgs "$tree" "$olderpkgs"
+fi
 
 # Remove given packages
 remove_pkgs "$tree" "$files"
This page took 0.031541 seconds and 4 git commands to generate.