summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2004-09-14 22:49:37 +0000
committerMarc Espie <espie@cvs.openbsd.org>2004-09-14 22:49:37 +0000
commit71b0e84a589c77b9bf93f02c2e032673c7bdb6ee (patch)
tree3a63937211a65c0634089f1c86f7e5c02f213c11 /usr.sbin
parent207e0970bcbf55a5ea60e4e2c7468f11dc5349f6 (diff)
better reporting of conflicts, suggested by naddy@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PkgCfl.pm4
-rw-r--r--usr.sbin/pkg_add/pkg_add5
2 files changed, 5 insertions, 4 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PkgCfl.pm b/usr.sbin/pkg_add/OpenBSD/PkgCfl.pm
index bab4266bd64..06a5558348a 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.2 2004/08/06 07:51:17 espie Exp $
+# $OpenBSD: PkgCfl.pm,v 1.3 2004/09/14 22:49:36 espie Exp $
#
# Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org>
#
@@ -51,7 +51,7 @@ sub conflicts_with
my ($self, @pkgnames) = @_;
for my $cfl (@$self) {
if (grep { m/$cfl/ } @pkgnames) {
- return 1;
+ return grep { m/$cfl/ } @pkgnames;
}
}
return 0;
diff --git a/usr.sbin/pkg_add/pkg_add b/usr.sbin/pkg_add/pkg_add
index f81d1a137df..518a160ac07 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.52 2004/09/14 22:47:48 espie Exp $
+# $OpenBSD: pkg_add,v 1.53 2004/09/14 22:49:36 espie Exp $
#
# Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org>
#
@@ -351,7 +351,8 @@ sub pre_add($$)
my $l = OpenBSD::PkgCfl->make_conflict_list($plist);
$handle->{conflicts} = $l;
if ($l->conflicts_with(installed_packages())) {
- print "package $pkg has conflicts\n";
+ print "package $pkg has conflicts: ",
+ join(' ', $l->conflicts_with(installed_packages())), "\n";
$errors++;
return undef unless $forced{conflicts};
}