release-tools/stage-release.sh: Use 'type -p' and realpath to find $0
authorRichard Levitte <levitte@openssl.org>
Tue, 18 Apr 2023 08:17:58 +0000 (10:17 +0200)
committerRichard Levitte <levitte@openssl.org>
Tue, 16 May 2023 03:54:35 +0000 (05:54 +0200)
This allows the release-aux directory to be found, even when a symbolic
link to this script is used.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/tools/pull/140)

release-tools/stage-release.sh

index 56adedab17eef29b7b5d499dd25e0cd61d67d619..aac54476bc148822054f90098a7bae6304b6a3c5 100755 (executable)
@@ -265,7 +265,7 @@ trap "exec 42>&-; rm $VERBOSITY_FIFO" 0 2
 # Setup ##############################################################
 
 # Check that we have the scripts that define functions we use
-RELEASE_AUX=$(cd $(dirname $0)/release-aux; pwd)
+RELEASE_AUX=$(dirname $(realpath $(type -p $0)))/release-aux
 found=true
 for fn in "$RELEASE_AUX/release-version-fn.sh" \
           "$RELEASE_AUX/release-state-fn.sh" \