|
@ -135,7 +135,7 @@ _mksum() { |
|
|
echo "$(md5sum "$@" 2> /dev/null | cut -d' ' -f1)" |
|
|
echo "$(md5sum "$@" 2> /dev/null | cut -d' ' -f1)" |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
_safe_sed() { |
|
|
safe_sed() { |
|
|
echo "$1" | sed 's/[[\.*^$/]/\\&/g' |
|
|
echo "$1" | sed 's/[[\.*^$/]/\\&/g' |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -151,7 +151,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 |
|
@ -165,7 +165,7 @@ extract() { |
|
|
_msg "Extracting $1" |
|
|
_msg "Extracting $1" |
|
|
[ "$2" ] && local dest="$2" || local dest='.' |
|
|
[ "$2" ] && local dest="$2" || local dest='.' |
|
|
[ "$3" ] && local cmd="$3" || local cmd="$cmd_extract" |
|
|
[ "$3" ] && local cmd="$3" || local cmd="$cmd_extract" |
|
|
eval $(echo "$cmd" | sed -e "s@{src}@'$dir_source/$name/$1'@g" -e "s@{dst}@'$dest'@g") |
|
|
eval $(echo "$cmd" | sed -e "s/{src}/'$(safe_sed "$dir_source/$name/$1")'/g" -e "s/{dst}/'$(safe_sed "$dest")'/g") |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
getfile() { |
|
|
getfile() { |
|
@ -206,7 +206,8 @@ option() { |
|
|
|
|
|
|
|
|
local enabled=false |
|
|
local enabled=false |
|
|
local opt |
|
|
local opt |
|
|
local IFS=','; for option in $options; do |
|
|
local IFS=',' |
|
|
|
|
|
for option in $options; do |
|
|
local option_negate=false |
|
|
local option_negate=false |
|
|
case "$option" in |
|
|
case "$option" in |
|
|
*=*) |
|
|
*=*) |
|
@ -301,7 +302,7 @@ dir_source="$(realpath "$dir_source")" |
|
|
|
|
|
|
|
|
if [ "$_download_only" = false ]; then |
|
|
if [ "$_download_only" = false ]; then |
|
|
# Fix up the install path |
|
|
# Fix up the install path |
|
|
dir_install="$(echo "$dir_install" | sed -e "s@{pkg}@$(_safe_sed "$satname")@g")" |
|
|
dir_install="$(echo "$dir_install" | sed -e "s/{pkg}/$(safe_sed "$satname")/g")" |
|
|
|
|
|
|
|
|
# This variable can be set by a wrapper script in need to nuke the install dir. |
|
|
# This variable can be set by a wrapper script in need to nuke the install dir. |
|
|
if [ "$_nuke_dir_install" = true -a ! -z "$dir_install" ]; then |
|
|
if [ "$_nuke_dir_install" = true -a ! -z "$dir_install" ]; then |
|
|