summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Update.pm33
-rw-r--r--usr.sbin/pkg_add/OpenBSD/UpdateSet.pm6
2 files changed, 20 insertions, 19 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Update.pm b/usr.sbin/pkg_add/OpenBSD/Update.pm
index cfef522a9f7..76aa74ba9df 100644
--- a/usr.sbin/pkg_add/OpenBSD/Update.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Update.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Update.pm,v 1.113 2009/12/07 13:41:02 espie Exp $
+# $OpenBSD: Update.pm,v 1.114 2009/12/12 17:08:07 espie Exp $
#
# Copyright (c) 2004-2006 Marc Espie <espie@openbsd.org>
#
@@ -80,10 +80,12 @@ sub process_handle
$state->say("Not updating .libs*, remember to clean them");
$first = 0;
}
+ $h->{keepit} = 1;
return 0;
}
if ($pkgname =~ m/^partial\-/o) {
$state->say("Not updating $pkgname, remember to clean it");
+ $h->{keepit} = 1;
return 0;
}
@@ -110,6 +112,16 @@ sub process_handle
my $found;
my $oldfound = 0;
+ # XXX this is nasty: maybe we added an old set to update
+ # because of conflicts, in which case the pkgpath +
+ # conflict should be enough to "match".
+ for my $n ($set->newer) {
+ if ($n->location->update_info->match_pkgpath($plist) &&
+ $n->plist->conflict_list->conflicts_with($pkgname)) {
+ $self->add_handle($set, $h, $n);
+ return 1;
+ }
+ }
if (!$state->{defines}->{downgrade}) {
push(@search, OpenBSD::Search::FilterLocation->more_recent_than($pkgname, \$oldfound));
}
@@ -152,17 +164,9 @@ sub process_handle
my $l = OpenBSD::PackageLocator->match_locations(@search);
if (@$l == 0) {
- # XXX this is nasty: maybe we added an old set to update
- # because of conflicts, in which case the pkgpath +
- # conflict should be enough to "match".
- for my $n ($set->newer) {
- if ($n->location->update_info->match_pkgpath($plist)) {
- $self->add_handle($set, $h, $n);
- return 1;
- }
- }
if ($oldfound) {
$h->{update_found} = $h;
+ $h->{keepit} = 1;
my $msg = "No need to update $pkgname";
if (defined $state->{todo} && $state->{todo} > 0) {
$msg .= " ($state->{todo} to go)";
@@ -177,6 +181,7 @@ sub process_handle
if (defined $found && $found eq $l->[0] &&
!$plist->uses_old_libs && !$state->{defines}->{installed}) {
$h->{update_found} = $h;
+ $h->{keepit} = 1;
my $msg = "No need to update $pkgname";
if (defined $state->{todo} && $state->{todo} > 0) {
$msg .= " ($state->{todo} to go)";
@@ -263,18 +268,14 @@ sub process_set
my $problem;
for my $h ($set->older, $set->hints) {
next if $h->{update_found};
- my $r = $h->update($self, $set, $state);
-
- if (!defined $r) {
+ if (!defined $h->update($self, $set, $state)) {
$problem = 1;
- } else {
- $set->{updates} += $r;
}
}
if ($problem) {
$state->tracker->cant($set) if !$set->{quirks};
return 0;
- } elsif ($set->{updates} == 0 && $set->newer == 0) {
+ } elsif ($set->older_to_do == 0 && $set->newer == 0) {
$state->tracker->uptodate($set);
return 0;
}
diff --git a/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm b/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm
index b32e05e6e6c..a3e3facefab 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.35 2009/12/07 15:09:08 espie Exp $
+# $OpenBSD: UpdateSet.pm,v 1.36 2009/12/12 17:08:07 espie Exp $
#
# Copyright (c) 2007 Marc Espie <espie@openbsd.org>
#
@@ -156,7 +156,8 @@ sub older_to_do
require OpenBSD::PackageInfo;
my @l = ();
for my $h ($self->older) {
- if (OpenBSD::PackageInfo::is_installed($h->pkgname)) {
+ if (!defined $h->{keepit} &&
+ OpenBSD::PackageInfo::is_installed($h->pkgname)) {
push(@l, $h);
}
}
@@ -262,7 +263,6 @@ sub merge
$set->{finished} = 1;
# XXX and mark it as merged, for eventual updates
$set->{merged} = $self;
- $self->{updates} += $set->{updates};
}
# then regen tracker info for $self
$tracker->todo($self);