summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2010-06-04 17:29:54 +0000
committerMarc Espie <espie@cvs.openbsd.org>2010-06-04 17:29:54 +0000
commit7c076ae73b0dc1f802a5b00141cdd0533b8e6097 (patch)
treee948c4e207f6164f4f354f34e04ef277db448743 /usr.sbin
parent5574b0581c72838fc2a238b4782532a13acdaf13 (diff)
add ->spec to Conflict and use the same check as for depend during pkg_create.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackingElement.pm10
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PkgCfl.pm4
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PkgCreate.pm8
3 files changed, 18 insertions, 4 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
index 92bcc24f830..bef30030cac 100644
--- a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: PackingElement.pm,v 1.177 2010/06/04 13:19:39 espie Exp $
+# $OpenBSD: PackingElement.pm,v 1.178 2010/06/04 17:29:53 espie Exp $
#
# Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org>
#
@@ -898,6 +898,14 @@ sub keyword() { "conflict" }
__PACKAGE__->register_with_factory;
sub category() { "conflict" }
+sub spec
+{
+ my $self =shift;
+
+ require OpenBSD::Search;
+ return OpenBSD::Search::PkgSpec->new($self->name);
+}
+
package OpenBSD::PackingElement::Dependency;
our @ISA=qw(OpenBSD::PackingElement::Depend);
use OpenBSD::Error;
diff --git a/usr.sbin/pkg_add/OpenBSD/PkgCfl.pm b/usr.sbin/pkg_add/OpenBSD/PkgCfl.pm
index 5d9b4a46e49..bd6256ff5da 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.30 2010/05/10 09:17:55 espie Exp $
+# $OpenBSD: PkgCfl.pm,v 1.31 2010/06/04 17:29:53 espie Exp $
#
# Copyright (c) 2003-2005 Marc Espie <espie@openbsd.org>
#
@@ -38,7 +38,7 @@ sub make_conflict_list
push(@$l, OpenBSD::Search::PkgSpec->new(".libs-$stem-*"));
if (defined $plist->{conflict}) {
for my $cfl (@{$plist->{conflict}}) {
- push(@$l, OpenBSD::Search::PkgSpec->new($cfl->name));
+ push(@$l, $cfl->spec);
}
}
bless $l, $class;
diff --git a/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm b/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm
index 6200916674d..ab9f30763de 100644
--- a/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm
@@ -1,6 +1,6 @@
#! /usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: PkgCreate.pm,v 1.1 2010/06/04 13:19:39 espie Exp $
+# $OpenBSD: PkgCreate.pm,v 1.2 2010/06/04 17:29:53 espie Exp $
#
# Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org>
#
@@ -347,6 +347,12 @@ sub avert_duplicates_and_other_checks
$self->SUPER::avert_duplicates_and_other_checks($state);
}
+package OpenBSD::PackingElement::Conflict;
+sub avert_duplicates_and_other_checks
+{
+ &OpenBSD::PackingElement::Depend::avert_duplicates_and_other_checks;
+}
+
package OpenBSD::PackingElement::AskUpdate;
sub avert_duplicates_and_other_checks
{