ci: Make sure to always clear meson-install checkout dir
We currently remove the directory at the end of the script, but that code is only reached when all previous operations were successful. Address this by first using an absolute directory path in /tmp instead of a "random" location based on the CWD, then set a trap to remove it on exit. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2712>
This commit is contained in:
parent
919812a851
commit
fac05b182c
@ -31,14 +31,13 @@ COMMIT="$2"
|
|||||||
SUBDIR="$3"
|
SUBDIR="$3"
|
||||||
PREPARE="$4"
|
PREPARE="$4"
|
||||||
|
|
||||||
REPO_DIR="$(basename ${REPO_URL%.git})"
|
CHECKOUT_DIR=$(mktemp --directory)
|
||||||
|
trap "rm -rf $CHECKOUT_DIR" EXIT
|
||||||
|
|
||||||
git clone --depth 1 "$REPO_URL" -b "$COMMIT"
|
git clone --depth 1 "$REPO_URL" -b "$COMMIT" "$CHECKOUT_DIR"
|
||||||
pushd "$REPO_DIR"
|
|
||||||
pushd "$SUBDIR"
|
pushd "$CHECKOUT_DIR/$SUBDIR"
|
||||||
sh -c "$PREPARE"
|
sh -c "$PREPARE"
|
||||||
meson setup --prefix=/usr _build "${MESON_OPTIONS[@]}"
|
meson setup --prefix=/usr _build "${MESON_OPTIONS[@]}"
|
||||||
meson install -C _build
|
meson install -C _build
|
||||||
popd
|
popd
|
||||||
popd
|
|
||||||
rm -rf "$REPO_DIR"
|
|
||||||
|
Loading…
Reference in New Issue
Block a user