From 14dd9df0f718f8d0815851efe52f3633ec6137b8 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 4 Oct 2023 17:46:35 +0000 Subject: makefile: symlink-install: do not depend on realpath For the Makefile, we can use $(PWD) make macro from make(1posix) as POSIX requires all environment variables be accessible as macros, and $PWD is a standard sh(1) environment variable. lei.sh must quiet the stderr of realpath before falling back to readlink(1) which is available on NetBSD. --- lei.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lei.sh') diff --git a/lei.sh b/lei.sh index f1510a73..afb03f3e 100755 --- a/lei.sh +++ b/lei.sh @@ -1,7 +1,7 @@ #!/bin/sh -e # symlink this file to a directory in PATH to run lei (or anything in script/*) # without needing perms to install globally. Used by "make symlink-install" -p=$(realpath "$0" || readlink "$0") # neither is POSIX, but common +p=$(realpath "$0" 2>/dev/null || readlink "$0") # neither is POSIX, but common p=$(dirname "$p") c=$(basename "$0") # both are POSIX exec ${PERL-perl} -w -I"$p"/lib "$p"/script/"${c%.sh}" "$@" : this script is too short to copyright -- cgit v1.2.3-24-ge0c7