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 +++++++++------- scripts/package.py | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'scripts') 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 diff --git a/scripts/package.py b/scripts/package.py index 3d2ae92..fe3b468 100755 --- a/scripts/package.py +++ b/scripts/package.py @@ -19,7 +19,7 @@ script_dir=`dirname $script_path` program_full_name="$PROGRAM_FULL_NAME" $DOWNLOAD_DEPENDENCIES_COMMAND -"$script_dir/$SO_LOADER" --library-path "$script_dir/libs":~/.local/lib/sibs/"$program_full_name":/usr/lib/sibs/"$program_full_name" "$script_dir/$PROGRAM_NAME" "$@" +"$script_dir/$SO_LOADER" --library-path "$script_dir/libs":$HOME/.local/lib/sibs/"$program_full_name":/usr/lib/sibs/"$program_full_name" "$script_dir/$PROGRAM_NAME" "$@" """ def get_executable_dynamic_libraries(filepath): -- cgit v1.2.3