summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2009-12-13 17:58:56 +0000
committerMarc Espie <espie@cvs.openbsd.org>2009-12-13 17:58:56 +0000
commit8bc211822df68d18462b2d9a364ea2f40a38b124 (patch)
tree3cde152563cd95207c0853f0bd01817c76111235 /usr.sbin
parent4f90ae7fb25e8bd9130270939d3899b840ab021f (diff)
okay, so old libs are not 'kept', keep track of updates correctly instead
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Update.pm6
-rw-r--r--usr.sbin/pkg_add/OpenBSD/UpdateSet.pm5
-rw-r--r--usr.sbin/pkg_add/pkg_add14
3 files changed, 20 insertions, 5 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Update.pm b/usr.sbin/pkg_add/OpenBSD/Update.pm
index 76aa74ba9df..37eba7e2d29 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.114 2009/12/12 17:08:07 espie Exp $
+# $OpenBSD: Update.pm,v 1.115 2009/12/13 17:58:55 espie Exp $
#
# Copyright (c) 2004-2006 Marc Espie <espie@openbsd.org>
#
@@ -80,7 +80,6 @@ sub process_handle
$state->say("Not updating .libs*, remember to clean them");
$first = 0;
}
- $h->{keepit} = 1;
return 0;
}
if ($pkgname =~ m/^partial\-/o) {
@@ -93,6 +92,7 @@ sub process_handle
eval {
if ($state->quirks->is_base_system($h, $state)) {
$h->{update_found} = 1;
+ $set->{updates}++;
}
};
return 1 if $h->{update_found};
@@ -275,7 +275,7 @@ sub process_set
if ($problem) {
$state->tracker->cant($set) if !$set->{quirks};
return 0;
- } elsif ($set->older_to_do == 0 && $set->newer == 0) {
+ } elsif ($set->{updates} == 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 ae35ba1690e..46bb9babd1b 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.37 2009/12/13 17:54:15 espie Exp $
+# $OpenBSD: UpdateSet.pm,v 1.38 2009/12/13 17:58:55 espie Exp $
#
# Copyright (c) 2007 Marc Espie <espie@openbsd.org>
#
@@ -80,6 +80,7 @@ sub add_newer
my $self = shift;
for my $h (@_) {
$self->{newer}->{$h->pkgname} = $h;
+ $self->{updates}++;
}
return $self;
}
@@ -248,6 +249,8 @@ sub merge
$self->add_older($set->older);
# ... and mark it as already done
$set->{finished} = 1;
+ $self->{updates} += $set->{updates};
+ $set->{updates} = 0;
# XXX and mark it as merged, for eventual updates
$set->{merged} = $self;
}
diff --git a/usr.sbin/pkg_add/pkg_add b/usr.sbin/pkg_add/pkg_add
index ef8422ad32c..a47fd81ea7f 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.423 2009/12/13 17:54:15 espie Exp $
+# $OpenBSD: pkg_add,v 1.424 2009/12/13 17:58:54 espie Exp $
#
# Copyright (c) 2003-2009 Marc Espie <espie@openbsd.org>
#
@@ -296,6 +296,7 @@ sub recheck_conflicts
{
my ($set, $state) = @_;
+ # no conflicts between newer sets
for my $h ($set->newer) {
for my $h2 ($set->newer) {
next if $h2 == $h;
@@ -305,6 +306,17 @@ sub recheck_conflicts
}
}
}
+
+ # and between newer sets and kept sets neither
+ for my $h ($set->newer) {
+ for my $h2 ($set->older) {
+ next unless $h2->{keepit};
+ if ($h->plist->conflict_list->conflicts_with($h2->pkgname) || $h2->plist->conflict_list->conflicts_with($h->pkgname)) {
+ $state->errsay($set->print, ": internal conflict between ", $h->pkgname, " and ", $h2->pkgname);
+ return 0;
+ }
+ }
+ }
return 1;
}