From 35d93a1a7bfe54d449f6fb4d7a0af3e3430185f6 Mon Sep 17 00:00:00 2001 From: espie Date: Sat, 7 Oct 2023 09:10:03 +0000 Subject: [PATCH] track firmware separately, since those will appear as uptodate for us --- usr.sbin/pkg_add/OpenBSD/Tracker.pm | 17 ++++++++++++++++- usr.sbin/pkg_add/OpenBSD/Update.pm | 3 ++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/usr.sbin/pkg_add/OpenBSD/Tracker.pm b/usr.sbin/pkg_add/OpenBSD/Tracker.pm index 4f25a8d424c..40751934acf 100644 --- a/usr.sbin/pkg_add/OpenBSD/Tracker.pm +++ b/usr.sbin/pkg_add/OpenBSD/Tracker.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Tracker.pm,v 1.31 2023/06/13 09:07:17 espie Exp $ +# $OpenBSD: Tracker.pm,v 1.32 2023/10/07 09:10:03 espie Exp $ # # Copyright (c) 2009 Marc Espie # @@ -101,6 +101,9 @@ sub add_set($self, $set) for my $n ($set->kept) { delete $self->{to_update}{$n->pkgname}; $self->{uptodate}{$n->pkgname} = 1; + if ($n->{is_firmware}) { + $self->{firmware}{$n->pkgname} = 1; + } } $self->known($set); $self->handle_set($set); @@ -134,6 +137,9 @@ sub uptodate($self, $set) $self->remove_set($set); for my $n ($set->older, $set->kept) { $self->{uptodate}{$n->pkgname} = 1; + if ($n->{is_firmware}) { + $self->{firmware}{$n->pkgname} = 1; + } } } @@ -198,6 +204,15 @@ sub cant_list($self) return keys %{$self->{cant_update}}; } +sub did_something($self) +{ + for my $k (keys %{$self->{uptodate}}) { + next if $self->{firmware}{$k}; + return 1; + } + return 0; +} + sub cant_install_list($self) { return keys %{$self->{cant_install}}; diff --git a/usr.sbin/pkg_add/OpenBSD/Update.pm b/usr.sbin/pkg_add/OpenBSD/Update.pm index 0ac0bc10395..1ba2277ce58 100644 --- a/usr.sbin/pkg_add/OpenBSD/Update.pm +++ b/usr.sbin/pkg_add/OpenBSD/Update.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Update.pm,v 1.170 2023/06/13 09:07:17 espie Exp $ +# $OpenBSD: Update.pm,v 1.171 2023/10/07 09:10:03 espie Exp $ # # Copyright (c) 2004-2014 Marc Espie # @@ -117,6 +117,7 @@ sub process_handle($self, $set, $h, $state) if ($plist->has('firmware') && !$state->defines('FW_UPDATE')) { $set->move_kept($h); + $h->{is_firmware} = 1; return 0; } -- 2.20.1