From 1b941c7782f07c61c61be36d7772a5c0ee9c420e Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 4 Oct 2018 01:26:44 +0200 Subject: Fix package scripts for older distros Tested on ubuntu 12.04 --- scripts/download_dependencies.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'scripts/download_dependencies.sh') diff --git a/scripts/download_dependencies.sh b/scripts/download_dependencies.sh index 8349068..ff68267 100755 --- a/scripts/download_dependencies.sh +++ b/scripts/download_dependencies.sh @@ -48,18 +48,20 @@ fi mkdir -p "$program_libs_dir" set +e +echoerr() { echo "$@" 1>&2; } + for (( i=0; i<${#dependencies[@]}; i=$i+2 )) do file=${dependencies[i]} checksum_file="$file".sha1 checksum=${dependencies[i+1]} - if [ -f /usr/lib/sibs/"$file" ] && [ "$checksum" == "$(cat /usr/lib/sibs/$checksum_file)" ]; then - #echo "Using sibs global lib file $file" - elif [ $is_root -eq 0 ] && [ -f ~/.local/lib/sibs/"$file" ] && [ "$checksum" == "$(cat ~/.local/lib/sibs/$checksum_file)" ]; then - #echo "Using sibs user lib file $file" + if [ -f /usr/lib/sibs/"$file" ] && [ "$checksum" == "$(cat /usr/lib/sibs/$checksum_file)" ]; then + echoerr "Using sibs global lib file $file" + elif [ $is_root -eq 0 ] && [ -f ~/.local/lib/sibs/"$file" ] && [ "$checksum" == "$(cat ~/.local/lib/sibs/$checksum_file)" ]; then + echoerr "Using sibs user lib file $file" elif [ -f /usr/lib/"$file" ] && echo "$checksum" /usr/lib/"$file" | sha1sum -c --status; then - #echo "Using system lib file $file" + echoerr "Using system lib file $file" set -e if [ $is_root -eq 0 ]; then cp /usr/lib/"$file" ~/.local/lib/sibs/"$file" @@ -79,8 +81,8 @@ do dst_dir=/usr/lib/sibs fi - #echo "Downloading missing library from $url/$file" - if wget -q --show-progress -O "$dst_dir/$file" "$url/$file"; then + echoerr "Downloading missing library from ${url}${file}" + if wget -q -O "$dst_dir/$file" "$url""$file"; then echo "$checksum" > "$dst_dir/$checksum_file" downloaded=1 break -- cgit v1.2.3