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