mirror of
https://gitee.com/openharmony/third_party_mesa3d
synced 2024-12-18 22:07:35 +00:00
6b9b9baeab
Signed-off-by: Andres Gomez <agomez@igalia.com> Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6388>
37 lines
785 B
Bash
37 lines
785 B
Bash
#!/bin/bash
|
|
|
|
set +e
|
|
set -o xtrace
|
|
|
|
# if we run this script outside of gitlab-ci for testing, ensure
|
|
# we got meaningful variables
|
|
CI_PROJECT_DIR=${CI_PROJECT_DIR:-$(mktemp -d)/mesa}
|
|
|
|
if [[ -e $CI_PROJECT_DIR/.git ]]
|
|
then
|
|
echo "Repository already present, skip cache download"
|
|
exit
|
|
fi
|
|
|
|
TMP_DIR=$(mktemp -d)
|
|
|
|
echo "Downloading archived master..."
|
|
/usr/bin/wget -O $TMP_DIR/mesa.tar.gz \
|
|
https://${MINIO_HOST}/git-cache/${FDO_UPSTREAM_REPO}/mesa.tar.gz
|
|
|
|
# check wget error code
|
|
if [[ $? -ne 0 ]]
|
|
then
|
|
echo "Repository cache not available"
|
|
exit
|
|
fi
|
|
|
|
set -e
|
|
|
|
rm -rf "$CI_PROJECT_DIR"
|
|
echo "Extracting tarball into '$CI_PROJECT_DIR'..."
|
|
mkdir -p "$CI_PROJECT_DIR"
|
|
tar xzf "$TMP_DIR/mesa.tar.gz" -C "$CI_PROJECT_DIR"
|
|
rm -rf "$TMP_DIR"
|
|
chmod a+w "$CI_PROJECT_DIR"
|