diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2009-10-19 14:20:56 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2009-10-19 14:20:56 +0000 |
commit | cae9efe447df1b885124387aff9de6b646f8b62d (patch) | |
tree | 5e02485315199fa3196088ca92fb226669b333af /usr.sbin/pkg_add | |
parent | 9b723e7e8154a3cc5c1b7bc5a3516527c0e7fde1 (diff) |
remove almost all references to set->handle, iterate over newer in most
cases (todo: rebuild dependency headers for the complex case...)
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/Dependencies.pm | 8 | ||||
-rw-r--r-- | usr.sbin/pkg_add/pkg_add | 12 |
2 files changed, 11 insertions, 9 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Dependencies.pm b/usr.sbin/pkg_add/OpenBSD/Dependencies.pm index a53a1ddf79c..3e3e8b58904 100644 --- a/usr.sbin/pkg_add/OpenBSD/Dependencies.pm +++ b/usr.sbin/pkg_add/OpenBSD/Dependencies.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Dependencies.pm,v 1.77 2009/10/15 22:41:50 espie Exp $ +# $OpenBSD: Dependencies.pm,v 1.78 2009/10/19 14:20:55 espie Exp $ # # Copyright (c) 2005-2007 Marc Espie <espie@openbsd.org> # @@ -345,7 +345,7 @@ sub dump print "Dependencies for ", $self->{set}->short_print, " resolve to: ", join(', ', $self->dependencies); print " (todo: ", - join(',', (map {$_->handle->pkgname} @{$self->{deplist}})), + join(',', (map {$_->short_print} @{$self->{deplist}})), ")" if @{$self->{deplist}} > 0; print "\n"; @@ -385,7 +385,7 @@ sub adjust_old_dependencies { my ($self, $state) = @_; for my $pkg ($self->{set}->newer) { - my $pkgname = $self->{set}->handle->pkgname; + my $pkgname = $pkg->pkgname; for my $o ($self->{set}->older) { next unless defined $o->{wantlist}; require OpenBSD::Replace; @@ -415,7 +415,7 @@ sub repair_dependencies { my ($self, $state) = @_; for my $p ($self->{set}->newer) { - my $pkgname = $self->{set}->handle->pkgname; + my $pkgname = $p->pkgname; for my $pkg (installed_packages(1)) { my $plist = OpenBSD::PackingList->from_installation( $pkg, \&OpenBSD::PackingList::DependOnly); diff --git a/usr.sbin/pkg_add/pkg_add b/usr.sbin/pkg_add/pkg_add index 5e2807d48e8..406bec8a128 100644 --- a/usr.sbin/pkg_add/pkg_add +++ b/usr.sbin/pkg_add/pkg_add @@ -1,7 +1,7 @@ #! /usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: pkg_add,v 1.362 2009/10/19 14:15:40 espie Exp $ +# $OpenBSD: pkg_add,v 1.363 2009/10/19 14:20:55 espie Exp $ # # Copyright (c) 2003-2009 Marc Espie <espie@openbsd.org> # @@ -77,9 +77,11 @@ sub build_deptree $pkg = $state->{deptree}->{$pkg}; } for my $i (@deps) { - my $j = $i->handle->pkgname; - $state->{deptree}->{$j} = $pkg unless - defined $state->{deptree}->{$j}; + for my $j ($i->newer) { + my $nj = $j->pkgname; + $state->{deptree}->{$nj} = $pkg unless + defined $state->{deptree}->{$nj}; + } } } @@ -296,8 +298,8 @@ sub really_add $set->validate_plists($state); my $errors = 0; - $state->set_name_from_handle($set->handle); for my $handle ($set->newer) { + $state->set_name_from_handle($handle); my $plist = $handle->plist; if ($plist->is_signed) { if ($state->{defines}->{nosig}) { |