summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD/Update.pm
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2009-11-30 18:45:15 +0000
committerMarc Espie <espie@cvs.openbsd.org>2009-11-30 18:45:15 +0000
commite1b0da13fb6d4f7ea77f62b3e535380041b052af (patch)
tree1385872f8f0afd73f7a4ae2098f0adfb678185c7 /usr.sbin/pkg_add/OpenBSD/Update.pm
parentbe5ae23d8ba7b70153d7b2647d0f18fe2ecc0840 (diff)
tweak the rules a bit: the search filter for "more recent than" ought to
notice it sees older stuff. Even if they get filtered later on, this would turn into a "no need to update". (in actual use, I probably will need to open those packages and look at the pkgpaths to make sure they are not valid candidates, and to compare full signatures... oh well)
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/Update.pm')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Update.pm15
1 files changed, 13 insertions, 2 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Update.pm b/usr.sbin/pkg_add/OpenBSD/Update.pm
index 1b6440e8425..edb050e5cf7 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.106 2009/11/29 12:12:15 espie Exp $
+# $OpenBSD: Update.pm,v 1.107 2009/11/30 18:45:14 espie Exp $
#
# Copyright (c) 2004-2006 Marc Espie <espie@openbsd.org>
#
@@ -97,9 +97,10 @@ sub process_handle
my @search = ();
push(@search, OpenBSD::Search::Stem->split($pkgname));
my $found;
+ my $oldfound = 0;
if (!$state->{defines}->{downgrade}) {
- push(@search, OpenBSD::Search::FilterLocation->more_recent_than($pkgname));
+ push(@search, OpenBSD::Search::FilterLocation->more_recent_than($pkgname, \$oldfound));
}
push(@search, OpenBSD::Search::FilterLocation->new(
sub {
@@ -149,6 +150,16 @@ sub process_handle
return 1;
}
}
+ if ($oldfound) {
+ $h->{update_found} = $h;
+ my $msg = "No need to update $pkgname";
+ if (defined $state->{todo} && $state->{todo} > 0) {
+ $msg .= " ($state->{todo} to go)";
+ }
+ $state->progress->message($msg);
+ $state->say($msg) if $state->{beverbose};
+ return 0;
+ }
return undef;
}
if (@$l == 1) {