In the case where no firmware are detected/installed fw_update is too
quiet.
This should fix things to show "none" in that case:
# fw_update
fw_update: added none; updated none; kept none
Is that what folks would expect?
This patch does not include the extra level of indentation that will
result, but that would obfuscate the change.
Comments, OK?
Index: usr.sbin/fw_update/fw_update.sh
===================================================================
RCS file: /cvs/src/usr.sbin/fw_update/fw_update.sh,v
retrieving revision 1.39
diff -u -p -r1.39 fw_update.sh
--- usr.sbin/fw_update/fw_update.sh 19 Feb 2022 02:19:42 -0000 1.39
+++ usr.sbin/fw_update/fw_update.sh 19 Feb 2022 19:54:24 -0000
@@ -492,14 +492,13 @@ else
{ [ "${devices[*]:-}" ] && echo " found." || echo " done." ; }
fi
-[ "${devices[*]:-}" ] || exit
-
-lock_db
added=''
updated=''
kept=''
unregister=''
+if [ "${devices[*]:-}" ]; then
+lock_db
for f in "${devices[@]}"; do
d="$( firmware_devicename "$f" )"
@@ -609,6 +608,7 @@ for f in "${devices[@]}"; do
updated="$updated,$d"
fi
done
+fi
added="${added:#,}"
updated="${updated:#,}"