|
|
@ -155,7 +155,7 @@ _mksum() { |
|
|
|
} |
|
|
|
|
|
|
|
safe_sed() { |
|
|
|
echo "$1" | sed 's/[[\.*^$/]/\\&/g' |
|
|
|
echo "$1" | sed 's/[[&\.*^$/]/\\&/g' |
|
|
|
} |
|
|
|
|
|
|
|
download() { |
|
|
@ -170,7 +170,7 @@ download() { |
|
|
|
_msg "Downloading $filename" |
|
|
|
|
|
|
|
[ "$3" ] && local cmd="$3" || local cmd="$cmd_download" |
|
|
|
eval $(echo "$cmd" | sed -e "s/{dst}/'$(safe_sed "$path")'/g" -e "s@{src}@'$(safe_sed "$1")'@g") |
|
|
|
eval $(echo "$cmd" | sed -e "s/{dst}/'$(safe_sed "$path")'/g" -e "s/{src}/'$(safe_sed "$1")'/g") |
|
|
|
|
|
|
|
checksum="$(_mksum "$path")" |
|
|
|
if [ "$2" -a "$checksum" != "$2" ]; then |
|
|
@ -197,12 +197,12 @@ extrafile() { |
|
|
|
|
|
|
|
dlextract() { |
|
|
|
download "$1" "$2" |
|
|
|
extract "$(basename $(echo "$1" | cut -d? -f1))" |
|
|
|
extract "$(basename "$(echo "$1" | cut -d? -f1)")" |
|
|
|
} |
|
|
|
|
|
|
|
dlfile() { |
|
|
|
download "$1" "$2" |
|
|
|
getfile "$(basename $(echo "$1" | cut -d? -f1))" |
|
|
|
getfile "$(basename "$(echo "$1" | cut -d? -f1)")" |
|
|
|
} |
|
|
|
|
|
|
|
option() { |
|
|
|