From b0be2c8c2025a6a6ac4e583577633f3e094b362c Mon Sep 17 00:00:00 2001 From: Marc Espie Date: Tue, 14 Sep 2004 22:28:24 +0000 Subject: new categories, modules and manual-installation, not active yet. new visit method, to do anything on a packing-list. --- usr.sbin/pkg_add/OpenBSD/PackingList.pm | 35 ++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) (limited to 'usr.sbin/pkg_add/OpenBSD/PackingList.pm') diff --git a/usr.sbin/pkg_add/OpenBSD/PackingList.pm b/usr.sbin/pkg_add/OpenBSD/PackingList.pm index bb650a2dff5..54b6db2d42f 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackingList.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackingList.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: PackingList.pm,v 1.21 2004/08/06 10:23:45 espie Exp $ +# $OpenBSD: PackingList.pm,v 1.22 2004/09/14 22:28:23 espie Exp $ # # Copyright (c) 2003-2004 Marc Espie # @@ -120,10 +120,10 @@ sub write $item->write($fh); } } - for my $unique_item (qw(name no-default-conflict extrainfo arch)) { + for my $unique_item (qw(name no-default-conflict manual-installation extrainfo arch)) { $self->{$unique_item}->write($fh) if defined $self->{$unique_item}; } - for my $listname (qw(pkgcfl pkgdep newdepend libdepend items)) { + for my $listname (qw(modules pkgcfl pkgdep newdepend libdepend items)) { if (defined $self->{$listname}) { for my $item (@{$self->{$listname}}) { $item->write($fh); @@ -135,6 +135,35 @@ sub write } } +sub visit +{ + my ($self, $method, @l) = @_; + + if (defined $self->{cvstags}) { + for my $item (@{$self->{cvstags}}) { + $item->$method(@l); + } + } + + for my $special (OpenBSD::PackageInfo::info_names()) { + $self->{$special}->$method(@l, 0) if defined $self->{$special}; + } + + for my $unique_item (qw(name no-default-conflict manual-installation extrainfo arch)) { + $self->{$unique_item}->$method(@l) if defined $self->{$unique_item}; + } + for my $listname (qw(modules pkgcfl pkgdep newdepend libdepend items)) { + if (defined $self->{$listname}) { + for my $item (@{$self->{$listname}}) { + $item->$method(@l); + } + } + } + for my $special (OpenBSD::PackageInfo::info_names()) { + $self->{$special}->$method(@l, 1) if defined $self->{$special}; + } +} + sub fromfile { my ($a, $fname, $code) = @_; -- cgit v1.2.3