mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-28 04:58:32 +00:00
fallback to alpine distfiles if upstream source has gone missing, fix #70
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
parent
4bb0da581f
commit
a8d4ffe20d
@ -1,6 +1,15 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
fail() {
|
fetch () {
|
||||||
|
wget $1
|
||||||
|
[ $? == 0 ] && exit 0
|
||||||
|
# try at archive if original source fails
|
||||||
|
BASE=$(basename $1)
|
||||||
|
# distfiles are split as v3.3, not v3.3.3
|
||||||
|
# edge is not available but should always be upstream
|
||||||
|
ALPINE=$(cat /hostetc/alpine-release | sed 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/')
|
||||||
|
wget http://distfiles.alpinelinux.org/distfiles/v${ALPINE}/$BASE
|
||||||
|
[ $? == 0 ] && exit 0
|
||||||
printf "\e[31m$1 \e[0m\n"
|
printf "\e[31m$1 \e[0m\n"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
@ -46,9 +55,8 @@ do
|
|||||||
then
|
then
|
||||||
cp -a $f "$srcdir"/$pkgname-$pkgver/
|
cp -a $f "$srcdir"/$pkgname-$pkgver/
|
||||||
else
|
else
|
||||||
cd "$srcdir"/$pkgname-$pkgver && \
|
( cd "$srcdir"/$pkgname-$pkgver && \
|
||||||
wget $f || fail "Cannot retrieve $f" && \
|
fetch $f )
|
||||||
cd -
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user