summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackageName.pm15
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PkgSpec.pm8
2 files changed, 21 insertions, 2 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageName.pm b/usr.sbin/pkg_add/OpenBSD/PackageName.pm
index 52d179f2167..726efefaef6 100644
--- a/usr.sbin/pkg_add/OpenBSD/PackageName.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PackageName.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: PackageName.pm,v 1.18 2007/05/07 14:29:06 espie Exp $
+# $OpenBSD: PackageName.pm,v 1.19 2007/05/13 12:55:54 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -304,6 +304,19 @@ sub to_pattern
return $o->{stem}.'-*';
}
+sub new
+{
+ my ($class, $stem) = @_;
+
+ return bless {stem => $stem}, $class;
+}
+
+sub split
+{
+ my ($class, $pkgname) = @_;
+ return $class->new(OpenBSD::PackageName::splitstem($pkgname));
+}
+
package OpenBSD::PackageName::Name;
sub to_string
{
diff --git a/usr.sbin/pkg_add/OpenBSD/PkgSpec.pm b/usr.sbin/pkg_add/OpenBSD/PkgSpec.pm
index 07f8f34c3ae..c8009f7fb92 100644
--- a/usr.sbin/pkg_add/OpenBSD/PkgSpec.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PkgSpec.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: PkgSpec.pm,v 1.8 2007/05/12 22:55:29 espie Exp $
+# $OpenBSD: PkgSpec.pm,v 1.9 2007/05/13 12:55:54 espie Exp $
#
# Copyright (c) 2003-2005 Marc Espie <espie@openbsd.org>
#
@@ -217,6 +217,12 @@ sub match_ref
return @l;
}
+sub match_repo
+{
+ my ($self, $o) = @_;
+ return $self->match_ref($o->list);
+}
+
sub match
{
my ($self, @list) = @_;