summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2004-12-16 11:30:17 +0000
committerMarc Espie <espie@cvs.openbsd.org>2004-12-16 11:30:17 +0000
commit0da9c87af40816e6acd93dceb6a96c8faeff69ec (patch)
tree23785872ced2a443583d2fc944a657eb6ec1d31c
parent7eef5f45ea0a981587960961af51656dd5dec7c0 (diff)
better conflict: conflict with partial installations, always conflict with
the package itself, and all potential instances of libraries.
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PkgCfl.pm10
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PkgCfl.pm b/usr.sbin/pkg_add/OpenBSD/PkgCfl.pm
index 19b8792e4ac..b1d8dc19ccc 100644
--- a/usr.sbin/pkg_add/OpenBSD/PkgCfl.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PkgCfl.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: PkgCfl.pm,v 1.7 2004/10/11 09:44:06 espie Exp $
+# $OpenBSD: PkgCfl.pm,v 1.8 2004/12/16 11:30:16 espie Exp $
#
# Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org>
#
@@ -36,11 +36,15 @@ sub make_conflict_list($)
{
my ($class, $plist) = @_;
my $l = [];
+ my $pkgname = $plist->pkgname();
+ my $stem = OpenBSD::PackageName::splitstem($pkgname);
unless (defined $plist->{'no-default-conflict'}) {
- my $stem = OpenBSD::PackageName::splitstem($plist->pkgname());
- push(@$l, sub { OpenBSD::PkgSpec::match($stem."-*", @_); });
+ push(@$l, sub { OpenBSD::PkgSpec::match("$stem-*|partial-$stem-*", @_); });
+ } else {
+ push(@$l, sub { grep { $_ eq $pkgname || $_ eq "partial-$pkgname"} @_;});
}
+ push(@$l, sub { OpenBSD::PkgSpec::match(".libs-$stem-*", @_); });
if (defined $plist->{pkgcfl}) {
for my $cfl (@{$plist->{pkgcfl}}) {
my $re = glob2re($cfl->{name});