with firmware known, recognize that we couldn't find any update at all
authorespie <espie@openbsd.org>
Sat, 7 Oct 2023 09:11:26 +0000 (09:11 +0000)
committerespie <espie@openbsd.org>
Sat, 7 Oct 2023 09:11:26 +0000 (09:11 +0000)
and just say that instead of a dauntingly long list of packages

usr.sbin/pkg_add/OpenBSD/PkgAdd.pm

index 23e9526..ad97455 100644 (file)
@@ -1,7 +1,7 @@
 #! /usr/bin/perl
 
 # ex:ts=8 sw=4:
-# $OpenBSD: PkgAdd.pm,v 1.143 2023/07/03 19:12:08 espie Exp $
+# $OpenBSD: PkgAdd.pm,v 1.144 2023/10/07 09:11:26 espie Exp $
 #
 # Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org>
 #
@@ -1112,6 +1112,16 @@ sub grab_debug_package($class, $d, $dbg, $state)
        }
 }
 
+sub report_cantupdate($state, $cantupdate)
+{
+       if ($state->tracker->did_something) {
+               $state->say("Couldn't find updates for #1", 
+                   join(' ', sort @$cantupdate));
+       } else {
+               $state->say("Couldn't find any update");
+       }
+}
+
 sub inform_user_of_problems($state)
 {
        my @cantupdate = $state->tracker->cant_list;
@@ -1120,10 +1130,8 @@ sub inform_user_of_problems($state)
                    sub($quirks) {
                        $quirks->filter_obsolete(\@cantupdate, $state);
                    });
-
-               $state->say("Couldn't find updates for #1", 
-                   join(' ', sort @cantupdate)) if @cantupdate > 0;
                if (@cantupdate > 0) {
+                       report_cantupdate($state, \@cantupdate);
                        $state->{bad}++;
                }
        }