summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2004-12-27 23:56:49 +0000
committerMarc Espie <espie@cvs.openbsd.org>2004-12-27 23:56:49 +0000
commitd3fa3fb2aace3245f59c21331077c61cb6783d0d (patch)
tree0095d4064532f84c34f127a987f582a720943962 /usr.sbin
parentf90d08a2b21bd02c7d721d69b47ecf31707a064a (diff)
allow pkg_add -r to proceed even if there's more than one conflict.
Put an arbitrary threshold at 5 conflicts, so that a package that conflicts with everything won't wipe everything out... Take inter-dependencies into account while adjusting dependencies: we can't adjust dependencies for stuff that is no longer there.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg_add/pkg_add9
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.sbin/pkg_add/pkg_add b/usr.sbin/pkg_add/pkg_add
index 81b7288be37..d81e0b9f722 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.161 2004/12/26 14:57:19 espie Exp $
+# $OpenBSD: pkg_add,v 1.162 2004/12/27 23:56:48 espie Exp $
#
# Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org>
#
@@ -81,7 +81,7 @@ sub can_install($$$)
return undef;
}
- if (@conflicts >= 2) {
+ if (@conflicts > 5) {
print "Can't install $pkgname because of conflicts (",join(',', @conflicts, @libs), ")\n";
$errors++;
return undef;
@@ -117,6 +117,7 @@ sub can_install($$$)
}
$rplist->{dir} = installed_info($toreplace);
push(@{$plist->{replacing}}, $rplist);
+ $plist->{skipupdatedeps} = \%conflicts;
}
return 1;
}
@@ -453,6 +454,10 @@ sub really_add($$)
if $state->{beverbose};
my $d = OpenBSD::RequiredBy->new($pkgname);
for my $dep (@{$op->{wantlist}}) {
+ if (defined $plist->{skipupdatedeps}->{$dep}) {
+ print "\tskipping $dep\n" if $state->{beverbose};
+ next;
+ }
print "\t$dep\n" if $state->{beverbose};
$d->add($dep);
OpenBSD::Update::adjust_dependency($dep, $opkgname, $pkgname);