|
@ -54,9 +54,13 @@ msg() { |
|
|
download() { |
|
|
download() { |
|
|
local name=$(basename "$1") |
|
|
local name=$(basename "$1") |
|
|
local path="$dir_source/$name" |
|
|
local path="$dir_source/$name" |
|
|
if [ ! -f "$path" ]; then |
|
|
local checksum="" |
|
|
|
|
|
if [ "$2" -a -f "$path" ]; then |
|
|
|
|
|
checksum="$(md5sum ""$path"" 2> /dev/null | cut -d' ' -f1)" |
|
|
|
|
|
fi |
|
|
|
|
|
if [ ! -f "$path" -o "$checksum" != "$2" ]; then |
|
|
msg "Downloading $name" |
|
|
msg "Downloading $name" |
|
|
if [ "$2" ]; then |
|
|
if [ "$3" ]; then |
|
|
local cmd="$(echo "$2" | sed -e 's@{dst}@'"$path"'@g' -e 's@{source}@'"$1"'@g')" |
|
|
local cmd="$(echo "$2" | sed -e 's@{dst}@'"$path"'@g' -e 's@{source}@'"$1"'@g')" |
|
|
$cmd |
|
|
$cmd |
|
|
else |
|
|
else |
|
@ -76,7 +80,7 @@ extract() { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
dlextract() { |
|
|
dlextract() { |
|
|
download "$1" |
|
|
download "$1" "$2" |
|
|
extract "$(basename ""$1"")" |
|
|
extract "$(basename ""$1"")" |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|