1
0
forked from 0ad/0ad

build-source-libs.sh: drop Perl dependency

Instead of using Perl to get the absolute path due to readlink -f
implementations differing behaviour use realpath. Since the inclusion
into coreutils this should be a valid alternative.

Also check for [[:space:]] instead of only \s as if that one is an issue
the others are as well.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
Ralph Sennhauser 2024-08-29 14:09:41 +02:00
parent bf82871ca8
commit 2b5ecd02a7

View File

@ -18,11 +18,9 @@ cd "$(dirname "$0")" || die
# Now in libraries/ (where we assume this script resides)
# Check for whitespace in absolute path; this will cause problems in the
# SpiderMonkey build and maybe elsewhere, so we just forbid it
# Use perl as an alternative to readlink -f, which isn't available on BSD
SCRIPTPATH=$(perl -MCwd -e 'print Cwd::abs_path shift' "$0")
case "$SCRIPTPATH" in
*\ *)
# SpiderMonkey build and maybe elsewhere, so we just forbid it.
case "$(realpath .)" in
*[[:space:]]*)
die "Absolute path contains whitespace, which will break the build - move the game to a path without spaces"
;;
esac