summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD/Update.pm
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2009-11-16 15:01:31 +0000
committerMarc Espie <espie@cvs.openbsd.org>2009-11-16 15:01:31 +0000
commit89b4744e285aab6945e82f6cb24aa0b123ceef03 (patch)
treec45b71572a25beb27a13e85d62db96196f52332f /usr.sbin/pkg_add/OpenBSD/Update.pm
parent2cc1ee1bc9a928fdb96b50ea985a4b5e63df5e66 (diff)
unify hints and normal updates some more
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/Update.pm')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Update.pm37
1 files changed, 36 insertions, 1 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Update.pm b/usr.sbin/pkg_add/OpenBSD/Update.pm
index 0ee017497a0..45f32f5d009 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.94 2009/11/16 14:47:05 espie Exp $
+# $OpenBSD: Update.pm,v 1.95 2009/11/16 15:01:30 espie Exp $
#
# Copyright (c) 2004-2006 Marc Espie <espie@openbsd.org>
#
@@ -162,4 +162,39 @@ sub process_hint
}
}
+sub process_set
+{
+ my ($self, $set, $state) = @_;
+ my $problem;
+ my $need_update;
+ for my $h ($set->older) {
+ next if $h->{done};
+ my $r = $self->process_handle($set, $h, $state);
+ if (!defined $r) {
+ $problem = 1;
+ }
+ if ($r) {
+ $need_update = 1;
+ }
+ }
+ for my $h ($set->hints) {
+ next if $h->{done};
+ my $r = $self->process_hint($set, $h, $state);
+ if (!defined $r) {
+ $problem = 1;
+ }
+ if ($r) {
+ $need_update = 1;
+ }
+ }
+ if ($problem) {
+ $state->tracker->mark_cantupdate($set);
+ return 0;
+ } elsif (!$need_update) {
+ $state->tracker->mark_uptoupdate($set);
+ return 0;
+ }
+ return 1;
+}
+
1;