From: Christian Goeschel Ndjomouo Date: Thu, 29 Jan 2026 02:42:43 +0000 (-0500) Subject: tools: expand relative paths provided by $top_srcdir for robustness X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db31873228e9be5c8970c9b853214359e37baa54;p=thirdparty%2Futil-linux.git tools: expand relative paths provided by $top_srcdir for robustness Signed-off-by: Christian Goeschel Ndjomouo --- diff --git a/tools/checkcompletion.sh b/tools/checkcompletion.sh index c92354a2c..bd3f14fdc 100755 --- a/tools/checkcompletion.sh +++ b/tools/checkcompletion.sh @@ -45,13 +45,13 @@ exclude_programs="nologin|agetty|login|sulogin|switch_root|vipw|line|kill" # These are handled via install-data-hook-bashcomp-* rules # - runuser: symlinked to su completion # - lastb: symlinked to last completion -special_handling="runuser|lastb" +special_handling="runuser|lastb" # Certain completions have an unusual algorithm that is distinct from the pattern used # in the majority of completion files, we skip these for now. unusual_completions="pipesz" -top_srcdir=${1:-.} +top_srcdir="$(realpath -qLs "${1:-.}")" [ -d "${top_srcdir}" ] || die "directory '${top_srcdir}' not found" cd "${top_srcdir}" || die "cannot cd to ${top_srcdir}" diff --git a/tools/checkmanpage.sh b/tools/checkmanpage.sh index 948e7fff9..588fc571c 100755 --- a/tools/checkmanpage.sh +++ b/tools/checkmanpage.sh @@ -17,9 +17,9 @@ # This script verifies if each program has a corresponding manpage # and checks if said manpages have a description for each program's # long options. The list of program long options is based on the -# respective program's source code. +# respective program's source code. -top_srcdir="${1:-.}" +top_srcdir="$(realpath -qLs "${1:-.}")" if [ -d "${top_srcdir}" ]; then shift 1 else diff --git a/tools/checkusage.sh b/tools/checkusage.sh index 4af5848ba..578035828 100755 --- a/tools/checkusage.sh +++ b/tools/checkusage.sh @@ -11,7 +11,7 @@ if [ "$#" -lt 1 ]; then exit 1 fi -top_srcdir=${1:-.} +top_srcdir="$(realpath -qLs "${1:-.}")" if [ -d "${top_srcdir}" ]; then shift 1 else @@ -154,7 +154,7 @@ function check_usage_long_options_completeness { prog_long_opts="$( TOP_SRCDIR="${top_srcdir}" "${top_srcdir}"/tools/get-options.sh "$prog" \ | sed -e 's/^$//' -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')" - + if [[ "$?" != "0" || -z "$prog_long_opts" ]]; then echo "Failed to get long options for $prog" return 1 diff --git a/tools/testcoverage.sh b/tools/testcoverage.sh index 9b3c668dd..95be3c474 100755 --- a/tools/testcoverage.sh +++ b/tools/testcoverage.sh @@ -24,7 +24,7 @@ # will be added to each respective tool's row and the script will # exit with a non-zero status code. -top_srcdir="${1:-.}" +top_srcdir="$(realpath -qLs "${1:-.}")" if [ -d "${top_srcdir}" ]; then shift 1 else