Skip to content

Commit cd87dc3

Browse files
committed
ShellScriptlets.py: fix meson setup command
1 parent efe357b commit cd87dc3

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

HaikuPorter/ShellScriptlets.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,8 @@ def getShellVariableSetters(shellVariables):
348348
# helper function to validate Meson invocations (and use the correct one)
349349
meson()
350350
{
351-
if [[ "$*" != *buildtype* ]]; then
351+
if [[ "$*" != *buildtype* ]] && [[ "$*" != compile* ]] \
352+
&& [[ "$*" != install* ]] && [[ "$*" != test* ]]; then
352353
echo "error: invoking meson without --buildtype argument"
353354
echo "note: you probably want --buildtype=release or --buildtype=debugoptimized"
354355
exit 1
@@ -365,7 +366,17 @@ def getShellVariableSetters(shellVariables):
365366
MESON=$(type -Pp meson)
366367
fi
367368
368-
$MESON --wrap-mode=nodownload "$@"
369+
if [[ "$*" != compile* ]] && [[ "$*" != install* ]] \
370+
&& [[ "$*" != test* ]]; then
371+
local PATTERN='^setup (.*)'
372+
if [[ "$*" =~ $PATTERN ]]; then
373+
$MESON setup --wrap-mode=nodownload ${BASH_REMATCH[1]}
374+
else
375+
$MESON --wrap-mode=nodownload "$@"
376+
fi
377+
else
378+
$MESON "$@"
379+
fi
369380
}
370381
371382
fixDevelopLibDirReferences()

0 commit comments

Comments
 (0)