spk rev 127
Some fixes to the --get option
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Sat Dec 21 22:15:24 2013 +0100 (2013-12-21) |
parents | 2fb881927791 |
children | 218ee0ee6502 |
files | lib/libspk.sh spk |
line diff
1.1 --- a/lib/libspk.sh Sat Dec 21 19:06:05 2013 +0100 1.2 +++ b/lib/libspk.sh Sat Dec 21 22:15:24 2013 +0100 1.3 @@ -162,7 +162,6 @@ 1.4 local pwd=$(pwd) 1.5 [ "$quiet" ] && local quiet="-q" 1.6 [ "$cache" ] && local pwd=$CACHE_DIR 1.7 - [ "$get" ] || local pwd=$CACHE_DIR 1.8 [ "$forced" ] && rm -f $pwd/$file 1.9 debug "download file: $file" 1.10 debug "DB: $db" 1.11 @@ -197,8 +196,8 @@ 1.12 cd $CACHE_DIR && check_download 1.13 fi 1.14 # Be sure the file was fetched. 1.15 - if [ ! -f "$pwd/$file" ] || [ ! -f "$CACHE_DIR/$file" ]; then 1.16 - gettext "ERROR: Missing file:"; colorize 31 " $file" 1.17 + if [ ! -f "$CACHE_DIR/$file" ] && [ ! -f "$pwd/$file" ]; then 1.18 + gettext "ERROR: Missing file:"; colorize 31 " $CACHE_DIR/$file" 1.19 newline && exit 1 1.20 fi 1.21 }
2.1 --- a/spk Sat Dec 21 19:06:05 2013 +0100 2.2 +++ b/spk Sat Dec 21 22:15:24 2013 +0100 2.3 @@ -112,6 +112,11 @@ 2.4 count=$(($count + 1)) 2.5 download $package_full $mirror 2.6 unset_mirrored 2.7 + if [ ! "$cache" ]; then 2.8 + gettext "Moving package to current directory..." 2.9 + mv -f "$CACHE_DIR/$package_full" . 2.10 + status 2.11 + fi 2.12 newline && continue ;; 2.13 esac 2.14 # Installed ?