index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | lolilolicon <lolilolicon@gmail.com> | 2011-09-29 10:45:20 +0800 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-09-29 13:02:41 -0500 |
commit | 83c05e71bc6e614f6f3d190d5e752a0c5239a2d1 (patch) | |
tree | eddaeb10baf0c7bdbac98c8a670e752d17f905b6 | |
parent | 1463a9aa3646a0886b7ec892f4a436ea5bb4749a (diff) |
-rwxr-xr-x | contrib/paccache.in | 8 |
diff --git a/contrib/paccache.in b/contrib/paccache.in index 11b7bbb5..7c35cf28 100755 --- a/contrib/paccache.in +++ b/contrib/paccache.in @@ -21,8 +21,8 @@ shopt -s extglob declare -a candidates=() cmdopts=() whitelist=() blacklist=() -declare -i delete=0 dryrun=0 filecount=0 keep=3 move=0 totalsaved=0 -declare cachedir=@localstatedir@/cache/pacman/pkg delim=$'\n' movedir= scanarch= +declare -i delete=0 dryrun=0 filecount=0 move=0 totalsaved=0 +declare cachedir=@localstatedir@/cache/pacman/pkg delim=$'\n' keep=3 movedir= scanarch= msg() { local mesg=$1; shift @@ -220,8 +220,10 @@ while getopts ':a:c:dfhi:k:m:rsuvz' opt; do blacklist+=("${ign[@]}") unset i ign ;; k) keep=$OPTARG - if [[ $keep != $OPTARG ]] || (( keep < 0 )); then + if [[ -z $keep || -n ${keep//[0-9]/} ]]; then die 'argument to option -k must be a non-negative integer' + else + keep=$(( 10#$keep )) fi ;; m) move=1 movedir=$OPTARG ;; r) delete=1 ;; |