summaryrefslogtreecommitdiff
path: root/.gitlab-ci
diff options
context:
space:
mode:
authorFlorian Müllner <fmuellner@gnome.org>2023-03-20 01:41:15 +0100
committerMarge Bot <marge-bot@gnome.org>2023-04-20 15:59:56 +0000
commitcdd8d335870481a3a994ab4673dc44e97a78e761 (patch)
treede639b8700744ff4cbf6ae40e5b529b05e4f90f8 /.gitlab-ci
parentfac05b182cd3e19199014e35fd5387a32d98d11e (diff)
downloadgnome-shell-cdd8d335870481a3a994ab4673dc44e97a78e761.tar.gz
ci: Use built-in option parsing in meson-install
This is less concise than the current ad-hoc parsing, but gets us error handling ("unknown option --foo") and is easier to extend. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2712>
Diffstat (limited to '.gitlab-ci')
-rwxr-xr-x.gitlab-ci/install-meson-project.sh23
1 files changed, 20 insertions, 3 deletions
diff --git a/.gitlab-ci/install-meson-project.sh b/.gitlab-ci/install-meson-project.sh
index fbb62b9d0..c49d50c7f 100755
--- a/.gitlab-ci/install-meson-project.sh
+++ b/.gitlab-ci/install-meson-project.sh
@@ -14,11 +14,28 @@ usage() {
EOF
}
+TEMP=$(getopt \
+ --name=$(basename $0) \
+ --options=D \
+ -- "$@")
+
+eval set -- "$TEMP"
+unset TEMP
+
MESON_OPTIONS=()
-while [[ $1 =~ ^-D ]]; do
- MESON_OPTIONS+=( "$1" )
- shift
+while true; do
+ case "$1" in
+ -D)
+ MESON_OPTIONS+=( -D$2 )
+ shift 2
+ ;;
+
+ --)
+ shift
+ break
+ ;;
+ esac
done
if [[ $# -lt 4 ]]; then