]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tools: expand relative paths provided by $top_srcdir for robustness
authorChristian Goeschel Ndjomouo <cgoesc2@wgu.edu>
Thu, 29 Jan 2026 02:42:43 +0000 (21:42 -0500)
committerChristian Goeschel Ndjomouo <cgoesc2@wgu.edu>
Tue, 3 Feb 2026 04:11:08 +0000 (23:11 -0500)
Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
tools/checkcompletion.sh
tools/checkmanpage.sh
tools/checkusage.sh
tools/testcoverage.sh

index c92354a2c46b96cfbf551590e26074f98607fee2..bd3f14fdc6776b5b75af32d09630ac63e7d0668b 100755 (executable)
@@ -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}"
index 948e7fff9bb24a4d8b7e6f878d906bb395b811c0..588fc571c2f2bfe58722f20ae29ef222fca74609 100755 (executable)
@@ -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
index 4af5848ba8de06ff65568d6a87ac1fc8bdd5d951..578035828e887a8c0f5938adb7eef15e1d139525 100755 (executable)
@@ -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
index 9b3c668dda5602c9554e207d4fe9a2c32774ce3f..95be3c4749c2844f8c77413cc41286b9dc41921b 100755 (executable)
@@ -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