test-avrdude: Adapt version check to new version format

The output of the version information in "avrdude -v" has changed between
avrdude 7.3 and now (commit cf0822bb71):

avrdude: Version 7.3

Avrdude version 7.3-20240814 (250a663a)

This means that the old grep call looking for "Version" cannot
find anything any more, and therefore needs to be changed.

This was not discovered as the test-avrdude script neglected to
abort if no version information is found.
This commit is contained in:
Hans Ulrich Niedermann
2024-08-14 15:39:01 +02:00
parent e5f4429cc6
commit a2906da411

View File

@@ -149,8 +149,8 @@ fi
arraylength=${#pgm_and_target[@]}
type "$avrdude_bin" >/dev/null 2>&1 || { echo "$progname: cannot execute $avrdude_bin"; exit 1; }
echo -n "Testing $avrdude_bin"
$avrdude_bin -v 2>&1 | grep Version | cut -f2- -d: | sed s/Version/version/
echo -n "Testing $avrdude_bin "
$avrdude_bin -v 2>&1 | grep '[vV]ersion' | sed 's/^.* [Vv]ersion/version/' | head -n1
[[ -d $tmp && -w $tmp ]] || tmp=/tmp # Fall back to /tmp if tmp directory unusable
status=$(mktemp "$tmp/$progname.status.XXXXXX")