From cfb6de94c3367d761e3db4d549c03e1a8360b0a3 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 30 Dec 2024 17:59:19 +0000 Subject: trees: correction on check_gnu_path i intend for this function to work generically, matching gnat to gcc or gcc to gnat, but there was a hangover from the previous code where it specifically assumed we were matching gnat this bug manifested when i tested with gnat being v13 and gcc being v14 in path, where gcc-13 was also available in path. Signed-off-by: Leah Rowe --- script/trees | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/trees b/script/trees index d07f3254..09240af0 100755 --- a/script/trees +++ b/script/trees @@ -232,7 +232,7 @@ check_gnu_path() eval "[ \"\$$_gnuarg\" = \"gnat\" ] && continue" $err "check_gnu_path: Invalid argument \"$_gnuarg\"" done - command -v $1 1>/dev/null || $err "Host gcc unavailable" + command -v $1 1>/dev/null || $err "Host '$1' unavailable" eval `setvars "" gccver gccfull gnatver gnatfull gccdir gnatdir` gnu_setver "$1" "$1" || $err "Command '$1' unavailable." @@ -246,7 +246,7 @@ check_gnu_path() for _gnubin in "$_gnudir/$2-"*; do [ -f "$_gnubin" ] || continue [ "${_gnubin#"$_gnudir/$2-"}" = "$_gnuver" ] || continue - gnatver="${_gnubin#"$_gnudir/$2-"}"; break + _gnuver="${_gnubin#"$_gnudir/$2-"}"; break done gnu_setver "$2" "$_gnudir/$2-$_gnuver" || return 1 [ "$gnatfull" = "$gccfull" ] || return 1 -- cgit v1.2.1