diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2004-11-21 13:32:19 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2004-11-21 13:32:19 +0000 |
commit | 1d4d34b1ca8fd77a8f7f586d6587ab2170d3ecab (patch) | |
tree | e968373c6966be211cbd497259dbfbcd717ec255 /usr.sbin/pkg_add/OpenBSD | |
parent | f20a79ca5b45abb60091799deba848686867de45 (diff) |
check_lib_specs -> check_lib_spec: check one spec at a time, and report on it.
Loop on libdepends now split lib specs by itself.
Better reports, slightly more efficient, clearer.
Use a local sub to factor out common code to deleting pkgspec and REQUIRING
file contents. Rephrase message to say `removing dependency ON'.
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/Delete.pm | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Delete.pm b/usr.sbin/pkg_add/OpenBSD/Delete.pm index e7c918cd601..ce6a7fcd8af 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.10 2004/11/14 19:25:45 espie Exp $ +# $OpenBSD: Delete.pm,v 1.11 2004/11/21 13:32:18 espie Exp $ # # Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org> # @@ -126,10 +126,12 @@ sub delete_plist # guard against duplicate pkgdep my $removed = {}; - for my $item (@{$plist->{pkgdep}}) { - my $name = $item->{name}; - next if defined $removed->{$name}; - print "remove dependency in $name\n" + + my $zap_dependency = sub { + my $name = shift; + + return if defined $removed->{$name}; + print "remove dependency on $name\n" if $state->{very_verbose} or $state->{not}; local $@; eval { OpenBSD::RequiredBy->new($name)->delete($pkgname) unless $state->{not}; }; @@ -137,17 +139,13 @@ sub delete_plist print STDERR "$@\n"; } $removed->{$name} = 1; + }; + + for my $item (@{$plist->{pkgdep}}) { + &$zap_dependency($item->{name}); } for my $name (OpenBSD::Requiring->new($pkgname)->list()) { - next if defined $removed->{$name}; - print "remove dependency in $name\n" - if $state->{very_verbose} or $state->{not}; - local $@; - eval { OpenBSD::RequiredBy->new($name)->delete($pkgname) unless $state->{not}; }; - if ($@) { - print STDERR "$@\n"; - } - $removed->{$name} = 1; + &$zap_dependency($name); } remove_packing_info($dir) unless $state->{not}; |