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