From 88b4d909edb50bcf7980a536923ed464352d067e Mon Sep 17 00:00:00 2001 From: espie Date: Wed, 22 Nov 2023 11:18:37 +0000 Subject: [PATCH] Prepare to do the updatedb stuff as an @option, so that the code is less ad-hoc --- usr.sbin/pkg_add/OpenBSD/PackingElement.pm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm index 8e0481f65f7..6a3387efc39 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: PackingElement.pm,v 1.289 2023/07/04 14:41:26 espie Exp $ +# $OpenBSD: PackingElement.pm,v 1.290 2023/11/22 11:18:37 espie Exp $ # # Copyright (c) 2003-2014 Marc Espie # @@ -828,6 +828,8 @@ sub new($class, $args) return OpenBSD::PackingElement::AlwaysUpdate->new_with_hash($1); } elsif ($args eq 'always-update') { return OpenBSD::PackingElement::AlwaysUpdate->new; + } elsif ($args eq 'updatedb') { + return OpenBSD::PackingElement::UpdateDB->new; } elsif ($args eq 'is-branch') { return OpenBSD::PackingElement::IsBranch->new; } else { @@ -867,6 +869,13 @@ package OpenBSD::PackingElement::Firmware; our @ISA=qw(OpenBSD::PackingElement::ManualInstallation); sub category($) { 'firmware' } +package OpenBSD::PackingElement::UpdateDB; +our @ISA=qw(OpenBSD::PackingElement::UniqueOption); +sub category($) +{ + 'updatedb'; +} + package OpenBSD::PackingElement::AlwaysUpdate; our @ISA=qw(OpenBSD::PackingElement::UniqueOption); -- 2.20.1