aboutsummaryrefslogtreecommitdiff
path: root/scripts/download_dependencies.sh
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-10-04 01:26:44 +0200
committerdec05eba <dec05eba@protonmail.com>2020-07-06 07:39:33 +0200
commit1b941c7782f07c61c61be36d7772a5c0ee9c420e (patch)
tree5eaeff7806c1bea62e0d87900871391a10dd6b1a /scripts/download_dependencies.sh
parent48ad8c87fd6cc901a4616f3ef02e7f163459a4c5 (diff)
Fix package scripts for older distros
Tested on ubuntu 12.04
Diffstat (limited to 'scripts/download_dependencies.sh')
-rwxr-xr-xscripts/download_dependencies.sh16
1 files changed, 9 insertions, 7 deletions
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