From 2b5ecd02a702939eea48ade6060e090cfb9be8b5 Mon Sep 17 00:00:00 2001 From: Ralph Sennhauser Date: Thu, 29 Aug 2024 14:09:41 +0200 Subject: [PATCH] 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 --- libraries/build-source-libs.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/libraries/build-source-libs.sh b/libraries/build-source-libs.sh index 00c420773e..e7340a6dda 100755 --- a/libraries/build-source-libs.sh +++ b/libraries/build-source-libs.sh @@ -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