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>
This commit is contained in:
Florian Müllner 2023-03-20 01:41:15 +01:00 committed by Marge Bot
parent fac05b182c
commit cdd8d33587

View File

@ -14,11 +14,28 @@ usage() {
EOF EOF
} }
TEMP=$(getopt \
--name=$(basename $0) \
--options=D \
-- "$@")
eval set -- "$TEMP"
unset TEMP
MESON_OPTIONS=() MESON_OPTIONS=()
while [[ $1 =~ ^-D ]]; do while true; do
MESON_OPTIONS+=( "$1" ) case "$1" in
shift -D)
MESON_OPTIONS+=( -D$2 )
shift 2
;;
--)
shift
break
;;
esac
done done
if [[ $# -lt 4 ]]; then if [[ $# -lt 4 ]]; then