|
@ -161,7 +161,7 @@ safe_sed() { |
|
|
download() { |
|
|
download() { |
|
|
mkdir -p "$dir_source/$name" |
|
|
mkdir -p "$dir_source/$name" |
|
|
|
|
|
|
|
|
local filename="$(basename $(echo "$1" | cut -d? -f1))" |
|
|
[ "$3" ] && local filename="$3" || local filename="$(basename $(echo "$1" | cut -d? -f1))" |
|
|
local path="$dir_source/$name/$filename" |
|
|
local path="$dir_source/$name/$filename" |
|
|
|
|
|
|
|
|
[ "$2" -a -f "$path" ] && local checksum="$(_mksum "$path")" |
|
|
[ "$2" -a -f "$path" ] && local checksum="$(_mksum "$path")" |
|
@ -169,7 +169,7 @@ download() { |
|
|
if [ ! -e "$path" -o "$checksum" != "$2" ]; then |
|
|
if [ ! -e "$path" -o "$checksum" != "$2" ]; then |
|
|
_msg "Downloading $filename" |
|
|
_msg "Downloading $filename" |
|
|
|
|
|
|
|
|
[ "$3" ] && local cmd="$3" || local cmd="$cmd_download" |
|
|
[ "$4" ] && local cmd="$4" || 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")" |
|
|