aboutsummaryrefslogtreecommitdiff
path: root/reproduce/analysis/bash/download-multi-try.sh
diff options
context:
space:
mode:
Diffstat (limited to 'reproduce/analysis/bash/download-multi-try.sh')
-rwxr-xr-xreproduce/analysis/bash/download-multi-try.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/reproduce/analysis/bash/download-multi-try.sh b/reproduce/analysis/bash/download-multi-try.sh
index 5cc5407..2df8aab 100755
--- a/reproduce/analysis/bash/download-multi-try.sh
+++ b/reproduce/analysis/bash/download-multi-try.sh
@@ -96,6 +96,25 @@ download_func () {
# Set the arguments.
inurl="$1"
+ # During the installation of basic software, the dependencies of the
+ # downloaders that are installed in Maneage can conflict with the
+ # downloader that is not yet installed in Maneage. To avoid this, we
+ # check if the downloader works (with '--version') and remove the
+ # Maneage library temporarily in case it does not.
+ lpathorig=""
+ dprog=$(echo $downloader | awk '{print $1}')
+ if ! $dprog --version > /dev/null 2> /dev/null; then
+ echo "NOTE: the segmentation fault is expected, is not a problem"
+ basedir=$(echo $outname \
+ | sed -e's|\/tarballs\/| |' \
+ | awk '{print $1}')
+ libdir=$basedir/installed/lib
+ lpathorig=$LD_LIBRARY_PATH
+ lpath=$(echo $LD_LIBRARY_PATH \
+ | sed -e's|'$libdir':||')
+ export LD_LIBRARY_PATH=$lpath
+ fi
+
# Attempt downloading the file. Note that the 'downloader' ends with
# the respective option to specify the output name. For example "wget
# -O" (so 'outname', that comes after it) will be the name of the
@@ -107,6 +126,11 @@ download_func () {
"if ! $downloader $outname \"$inurl\"; then rm -f $outname; fi"
fi
+ # In case the LD_LIBRARY_PATH was changed, set it back to normal.
+ if ! [ x"$lpathorig" = x ]; then
+ export LD_LIBRARY_PATH=$lpathorig
+ fi
+
# Some servers return HTTP 4xx/5xx errors as an HTML page with a 200
# status, so the downloader exits 0 and saves the HTML body to disk.
# Detect this by checking whether the response starts with an HTML tag