From a2906da411e6326a248eaa84e622148fb439ac99 Mon Sep 17 00:00:00 2001 From: Hans Ulrich Niedermann Date: Wed, 14 Aug 2024 15:39:01 +0200 Subject: [PATCH] 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 cf0822bb71086bf633c3166b21beb3201ad202dd): 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. --- tools/test-avrdude | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/test-avrdude b/tools/test-avrdude index 2ecacadc..a1f2fb46 100755 --- a/tools/test-avrdude +++ b/tools/test-avrdude @@ -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")