mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
.github: use a smarter cloning script
Several sites we need to clone our dependencies from (eg. freedesktop.org) have pretty unreliable servers, so our CI jobs often fail just because of temporary clone failure. Therefore adding a separate cloning script, which is more clever with automatic retries, but it also tries to keep the traffic low (eg. trying shallow clones if possible) and automatically detecting whether we're pulling a ref or a direct commit. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
37
.github/scripts/util.sh
vendored
37
.github/scripts/util.sh
vendored
@@ -1,41 +1,30 @@
|
||||
|
||||
. .github/scripts/conf.sh
|
||||
|
||||
SOURCE_DIR=`pwd`
|
||||
|
||||
clone_source() {
|
||||
local pkgname="$1"
|
||||
local url="$2"
|
||||
local ref="$3"
|
||||
local commit="$4"
|
||||
|
||||
if [ ! -f $pkgname/.git/config ]; then
|
||||
echo "need to clone $pkgname"
|
||||
if [ "$commit" ]; then
|
||||
git clone $url $pkgname --branch=$ref
|
||||
else
|
||||
git clone $url $pkgname --branch=$ref --depth 1
|
||||
fi
|
||||
else
|
||||
echo "already cloned $pkgname"
|
||||
fi
|
||||
|
||||
if [ "$commit" ]; then
|
||||
( cd $pkgname && git checkout -f "$commit" )
|
||||
fi
|
||||
$SOURCE_DIR/.github/scripts/git-smart-checkout.sh \
|
||||
--name "$pkgname" \
|
||||
--url "$url" \
|
||||
--ref "$ref"
|
||||
}
|
||||
|
||||
build_meson() {
|
||||
local pkgname="$1"
|
||||
local url="$2"
|
||||
local ref="$3"
|
||||
local commit="$4"
|
||||
shift
|
||||
shift
|
||||
shift
|
||||
shift || true
|
||||
if [ -f $X11_PREFIX/$pkgname.DONE ]; then
|
||||
echo "package $pkgname already built"
|
||||
else
|
||||
clone_source "$pkgname" "$url" "$ref" "$commit"
|
||||
clone_source "$pkgname" "$url" "$ref"
|
||||
(
|
||||
cd $pkgname
|
||||
meson "$@" build -Dprefix=$X11_PREFIX
|
||||
@@ -49,15 +38,13 @@ build_ac() {
|
||||
local pkgname="$1"
|
||||
local url="$2"
|
||||
local ref="$3"
|
||||
local commit="$4"
|
||||
shift
|
||||
shift
|
||||
shift
|
||||
shift || true
|
||||
if [ -f $X11_PREFIX/$pkgname.DONE ]; then
|
||||
echo "package $pkgname already built"
|
||||
else
|
||||
clone_source "$pkgname" "$url" "$ref" "$commit"
|
||||
clone_source "$pkgname" "$url" "$ref"
|
||||
(
|
||||
cd $pkgname
|
||||
./autogen.sh --prefix=$X11_PREFIX
|
||||
@@ -71,12 +58,10 @@ build_drv_ac() {
|
||||
local pkgname="$1"
|
||||
local url="$2"
|
||||
local ref="$3"
|
||||
local commit="$4"
|
||||
shift
|
||||
shift
|
||||
shift
|
||||
shift || true
|
||||
clone_source "$pkgname" "$url" "$ref" "$commit"
|
||||
clone_source "$pkgname" "$url" "$ref"
|
||||
(
|
||||
cd $pkgname
|
||||
./autogen.sh # --prefix=$X11_PREFIX
|
||||
@@ -88,15 +73,13 @@ build_ac_xts() {
|
||||
local pkgname="$1"
|
||||
local url="$2"
|
||||
local ref="$3"
|
||||
local commit="$4"
|
||||
shift
|
||||
shift
|
||||
shift
|
||||
shift || true
|
||||
if [ -f $X11_PREFIX/$pkgname.DONE ]; then
|
||||
echo "package $pkgname already built"
|
||||
else
|
||||
clone_source "$pkgname" "$url" "$ref" "$commit"
|
||||
clone_source "$pkgname" "$url" "$ref"
|
||||
(
|
||||
cd $pkgname
|
||||
CFLAGS='-fcommon'
|
||||
|
||||
Reference in New Issue
Block a user