build-system: Don't fail if tarball is there but no dir

The previous code assumed everything was good to go if just the tar ball
was there, but if it wasn't unpacked, it all went sideways.

This makes it more robust and to actually handle that the tarball might
just be there.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
This commit is contained in:
Anton Lundin 2018-06-18 22:23:12 +02:00 committed by Dirk Hohndel
parent 5f4006ae4f
commit c4bf9e6d6e

View file

@ -67,6 +67,9 @@ curl_download_library() {
if [ ! -f "$filename" ]; then if [ ! -f "$filename" ]; then
${CURL} "${base_url}${filename}" ${CURL} "${base_url}${filename}"
fi
if [ ! -d "$name" ] || [ "$name" -ot "$filename" ] ; then
rm -rf "$name" rm -rf "$name"
mkdir "$name" mkdir "$name"
tar -C "$name" --strip-components=1 -xf "$filename" tar -C "$name" --strip-components=1 -xf "$filename"