From 2fcee420111a70f94958f551d9fb753d6dde25ac Mon Sep 17 00:00:00 2001 From: espie Date: Wed, 13 Apr 2022 21:20:23 +0000 Subject: [PATCH] track ::Sample and ::Extra across an UpdateSet so that we may eventually give out more accurate diagnostic (soon !) --- usr.sbin/pkg_add/OpenBSD/Add.pm | 13 ++++++++++++- usr.sbin/pkg_add/OpenBSD/UpdateSet.pm | 4 +++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/usr.sbin/pkg_add/OpenBSD/Add.pm b/usr.sbin/pkg_add/OpenBSD/Add.pm index 189406e79c7..d7ff6a4f8d2 100644 --- a/usr.sbin/pkg_add/OpenBSD/Add.pm +++ b/usr.sbin/pkg_add/OpenBSD/Add.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Add.pm,v 1.188 2022/03/17 21:45:51 espie Exp $ +# $OpenBSD: Add.pm,v 1.189 2022/04/13 21:20:23 espie Exp $ # # Copyright (c) 2003-2014 Marc Espie # @@ -626,6 +626,14 @@ sub install $self->set_modes($state, $destdir.$fullname); } +package OpenBSD::PackingElement::Extra; +sub find_extractible +{ + my ($self, $state, $wanted, $tied) = @_; + + $state->{current_set}{known_extra}{$self->fullname} = 1; +} + package OpenBSD::PackingElement::RcScript; sub install { @@ -664,6 +672,9 @@ sub prepare_for_addition sub find_extractible { + my ($self, $state, $wanted, $tied) = @_; + + $state->{current_set}{known_sample}{$self->fullname} = 1; } sub extract diff --git a/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm b/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm index 13bfe46594e..a258a57a0be 100644 --- a/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm +++ b/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: UpdateSet.pm,v 1.86 2022/03/17 21:45:52 espie Exp $ +# $OpenBSD: UpdateSet.pm,v 1.87 2022/04/13 21:20:23 espie Exp $ # # Copyright (c) 2007-2010 Marc Espie # @@ -121,6 +121,8 @@ sub cleanup delete $self->{known_mandirs}; delete $self->{known_displays}; delete $self->{dont_delete}; + delete $self->{known_extra}; + delete $self->{known_sample}; $self->mark_as_finished; } -- 2.20.1