diff options
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/Add.pm | 4 | ||||
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/Delete.pm | 6 | ||||
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackageLocator.pm | 8 | ||||
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/Replace.pm | 12 | ||||
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/SharedItems.pm | 4 | ||||
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/SharedLibs.pm | 8 | ||||
-rw-r--r-- | usr.sbin/pkg_add/pkg_create | 6 | ||||
-rw-r--r-- | usr.sbin/pkg_add/pkg_info | 8 | ||||
-rw-r--r-- | usr.sbin/pkg_add/pkg_merge | 2 | ||||
-rw-r--r-- | usr.sbin/pkg_add/pkg_mklocatedb | 6 |
10 files changed, 35 insertions, 29 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Add.pm b/usr.sbin/pkg_add/OpenBSD/Add.pm index c2fda7e4a57..fafb859e5ec 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.51 2007/04/15 10:17:29 espie Exp $ +# $OpenBSD: Add.pm,v 1.52 2007/04/29 11:09:29 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> # @@ -65,7 +65,7 @@ sub validate_plist($$) my $totsize = 0; my $colliding = []; - $plist->visit('validate', $state, \$problems, $colliding, \$totsize, $plist->pkgname()); + $plist->validate($state, \$problems, $colliding, \$totsize, $plist->pkgname()); if (@$colliding > 0) { require OpenBSD::CollisionReport; diff --git a/usr.sbin/pkg_add/OpenBSD/Delete.pm b/usr.sbin/pkg_add/OpenBSD/Delete.pm index 87db9f6c2f3..fa12878a932 100644 --- a/usr.sbin/pkg_add/OpenBSD/Delete.pm +++ b/usr.sbin/pkg_add/OpenBSD/Delete.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Delete.pm,v 1.35 2007/04/15 10:17:29 espie Exp $ +# $OpenBSD: Delete.pm,v 1.36 2007/04/29 11:09:29 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> # @@ -102,7 +102,7 @@ sub validate_plist($$) my $destdir = $state->{destdir}; $state->{problems} = 0; $state->{totsize} = 0; - $plist->visit('prepare_for_deletion', $state); + $plist->prepare_for_deletion($state); my $dir = installed_info($plist->pkgname()); for my $i (info_names()) { my $fname = $dir.$i; @@ -168,7 +168,7 @@ sub delete_plist if ($plist->has(DEINSTALL)) { $plist->get(DEINSTALL)->delete($state); } - $plist->visit('register_manpage', $state); + $plist->register_manpage($state); manpages_unindex($state); my $donesize = 0; for my $item (@{$plist->{groups}}, @{$plist->{users}}, @{$plist->{items}}) { diff --git a/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm b/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm index d34d601548a..4323a7d998c 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: PackageLocator.pm,v 1.55 2007/04/15 10:17:29 espie Exp $ +# $OpenBSD: PackageLocator.pm,v 1.56 2007/04/29 11:09:29 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> # @@ -115,4 +115,10 @@ sub cleanup $pkgpath->cleanup(); } +sub match_spec +{ + my $self = shift; + return $pkgpath->match_spec(@_); +} + 1; diff --git a/usr.sbin/pkg_add/OpenBSD/Replace.pm b/usr.sbin/pkg_add/OpenBSD/Replace.pm index 928cc99f208..8a61ff5fb6c 100644 --- a/usr.sbin/pkg_add/OpenBSD/Replace.pm +++ b/usr.sbin/pkg_add/OpenBSD/Replace.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Replace.pm,v 1.4 2007/04/15 10:17:29 espie Exp $ +# $OpenBSD: Replace.pm,v 1.5 2007/04/29 11:09:29 espie Exp $ # # Copyright (c) 2004-2006 Marc Espie <espie@openbsd.org> # @@ -256,7 +256,7 @@ sub can_do Fatal "Couldn't find packing-list for $toreplace\n"; } $state->{journal} = []; - $plist->visit('can_update', 0, $state); + $plist->can_update(0, $state); if ($state->{okay} == 0) { Warn "Old package ", $plist->pkgname(), " contains potentially unsafe operations\n"; for my $i (@{$state->{journal}}) { @@ -286,7 +286,7 @@ sub can_do if (!defined $p2) { Warn "Error: $wanting missing from installation\n" } else { - $p2->visit('validate_depend', $state, $wanting, + $p2->validate_depend($state, $wanting, $toreplace, $replacement); } } @@ -312,7 +312,7 @@ sub is_safe my ($plist, $state) = @_; $state->{okay} = 1; $state->{journal} = []; - $plist->visit('can_update', 1, $state); + $plist->can_update(1, $state); if ($state->{okay} == 0) { Warn "New package ", $plist->pkgname(), " contains potentially unsafe operations\n"; @@ -443,8 +443,8 @@ sub save_old_libraries print "Looking for changes in shared libraries\n" if $state->{beverbose}; - $old_plist->visit('mark_lib', $libs, $p); - $new_plist->visit('unmark_lib', $libs, $p); + $old_plist->mark_lib($libs, $p); + $new_plist->unmark_lib($libs, $p); if (%$libs) { print "Libraries to keep: ", join(",", sort(keys %$libs)), "\n" diff --git a/usr.sbin/pkg_add/OpenBSD/SharedItems.pm b/usr.sbin/pkg_add/OpenBSD/SharedItems.pm index 78cc36c5e31..080d8a3f51e 100644 --- a/usr.sbin/pkg_add/OpenBSD/SharedItems.pm +++ b/usr.sbin/pkg_add/OpenBSD/SharedItems.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: SharedItems.pm,v 1.7 2007/04/15 10:17:29 espie Exp $ +# $OpenBSD: SharedItems.pm,v 1.8 2007/04/29 11:09:29 espie Exp $ # # Copyright (c) 2004-2006 Marc Espie <espie@openbsd.org> # @@ -35,7 +35,7 @@ sub find_items_in_installed_packages OpenBSD::ProgressMeter::show($done, $total); my $plist = OpenBSD::PackingList->from_installation($e, \&OpenBSD::PackingList::SharedItemsOnly) or next; - $plist->visit('record_shared_item', $e, $db); + $plist->record_shared_item($e, $db); $done++; } return $db; diff --git a/usr.sbin/pkg_add/OpenBSD/SharedLibs.pm b/usr.sbin/pkg_add/OpenBSD/SharedLibs.pm index c5d20943586..50ae3986769 100644 --- a/usr.sbin/pkg_add/OpenBSD/SharedLibs.pm +++ b/usr.sbin/pkg_add/OpenBSD/SharedLibs.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: SharedLibs.pm,v 1.9 2007/04/15 10:17:29 espie Exp $ +# $OpenBSD: SharedLibs.pm,v 1.10 2007/04/29 11:09:29 espie Exp $ # # Copyright (c) 2003-2005 Marc Espie <espie@openbsd.org> # @@ -146,7 +146,7 @@ sub add_package_libs } } - $plist->visit('mark_available_lib', $pkgname); + $plist->mark_available_lib($pkgname); } sub add_bogus_package_libs @@ -162,7 +162,7 @@ sub add_bogus_package_libs Warn "Can't read plist for $pkgname\n"; return; } - $plist->visit('mark_bogus_lib', $pkgname); + $plist->mark_bogus_lib($pkgname); } sub add_plist_libs @@ -171,7 +171,7 @@ sub add_plist_libs my $pkgname = $plist->pkgname(); return if $done_plist->{$pkgname}; $done_plist->{$pkgname} = 1; - $plist->visit('mark_available_lib', $pkgname); + $plist->mark_available_lib($pkgname); } sub _lookup_libspec diff --git a/usr.sbin/pkg_add/pkg_create b/usr.sbin/pkg_add/pkg_create index 00a38a2257d..18258725036 100644 --- a/usr.sbin/pkg_add/pkg_create +++ b/usr.sbin/pkg_add/pkg_create @@ -1,6 +1,6 @@ #! /usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: pkg_create,v 1.53 2007/04/15 10:17:29 espie Exp $ +# $OpenBSD: pkg_create,v 1.54 2007/04/29 11:09:29 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> # @@ -453,7 +453,7 @@ if (defined $opt_L) { if ($regen_package) { my $v = 0; - $plist->visit('anything', \$v); + $plist->anything(\$v); if ($v != 0 || @contents != 1) { Usage "Exactly one single packing list is required"; } @@ -573,7 +573,7 @@ if (!defined $plist->{name}) { if (defined $opt_q) { if (defined $opt_Q) { - $plist->visit('print_file'); + $plist->print_file; } else { $plist->write(\*STDOUT); } diff --git a/usr.sbin/pkg_add/pkg_info b/usr.sbin/pkg_add/pkg_info index 146157721ff..28b06d11dfb 100644 --- a/usr.sbin/pkg_add/pkg_info +++ b/usr.sbin/pkg_add/pkg_info @@ -1,6 +1,6 @@ #! /usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: pkg_info,v 1.42 2007/04/15 10:17:29 espie Exp $ +# $OpenBSD: pkg_info,v 1.43 2007/04/29 11:09:29 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> # @@ -158,7 +158,7 @@ sub filter_files my $plist = $handle->plist(\&OpenBSD::PackingList::FilesOnly); - $plist->visit('hunt_file', $search, $pkgname, \@result); + $plist->hunt_file($search, $pkgname, \@result); }); } return @result; @@ -283,12 +283,12 @@ sub print_info } if ($opt_L) { print $opt_l, "Files:\n" unless $opt_q; - $plist->visit('dump_file', $opt_K); + $plist->dump_file($opt_K); print "\n"; } if ($opt_s) { my $size = 0; - $plist->visit('sum_up', \$size); + $plist->sum_up(\$size); print "Size: " unless $opt_q; print "$size\n"; $total_size += $size; diff --git a/usr.sbin/pkg_add/pkg_merge b/usr.sbin/pkg_add/pkg_merge index 554b05a3600..8479c4b9f0a 100644 --- a/usr.sbin/pkg_add/pkg_merge +++ b/usr.sbin/pkg_add/pkg_merge @@ -162,7 +162,7 @@ for my $pkgname (@ARGV) { }; my $e = OpenBSD::PackingElement::FCONTENTS->new(CONTENTS); $e->copy_over($wrarc, $prefix, $true_package); - $plist->visit('mark_tocopy', $in->{tocopy}); + $plist->mark_tocopy($in->{tocopy}); push(@tomerge, $in); $prefix++; } diff --git a/usr.sbin/pkg_add/pkg_mklocatedb b/usr.sbin/pkg_add/pkg_mklocatedb index 712cf7049fb..4d2dbeb5625 100644 --- a/usr.sbin/pkg_add/pkg_mklocatedb +++ b/usr.sbin/pkg_add/pkg_mklocatedb @@ -152,7 +152,7 @@ if ($opt_p) { $done = 1; }); if (defined $plist && defined $plist->pkgname()) { - $plist->visit('print_name', $fh, info($plist)); + $plist->print_name($fh, info($plist)); } } close($in); @@ -161,12 +161,12 @@ if ($opt_p) { elsif (@ARGV==0) { for my $pkgname (installed_packages()) { my $plist = OpenBSD::PackingList->from_installation($pkgname); - $plist->visit('print_name', $fh, info($plist)); + $plist->print_name($fh, info($plist)); } } else { for my $pkgname (@ARGV) { my $plist = OpenBSD::PackageLocator->grabPlist($pkgname); next unless $plist; - $plist->visit('print_name', $fh, info($plist)); + $plist->print_name($fh, info($plist)); } } |