summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD/PackageName.pm
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2007-05-14 10:53:32 +0000
committerMarc Espie <espie@cvs.openbsd.org>2007-05-14 10:53:32 +0000
commit1f94b8d9a850dbb366ebbd30c37f8e1446017987 (patch)
tree35cce9bc8f1299f6ff45bf2a374669c415c8071a /usr.sbin/pkg_add/OpenBSD/PackageName.pm
parentb625ec4ca173b166b6eed5bafd2aa02064886be0 (diff)
put search objects into a search class.
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/PackageName.pm')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackageName.pm39
1 files changed, 17 insertions, 22 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageName.pm b/usr.sbin/pkg_add/OpenBSD/PackageName.pm
index 1ceabd06aab..085d1026997 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.24 2007/05/14 10:43:45 espie Exp $
+# $OpenBSD: PackageName.pm,v 1.25 2007/05/14 10:53:31 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -308,6 +308,20 @@ sub to_pattern
return $o->{stem}.'-*';
}
+package OpenBSD::PackageName::Name;
+sub to_string
+{
+ my $o = shift;
+ return join('-', $o->{stem}, $o->{version}->to_string, @{$o->{flavors}});
+}
+
+sub to_pattern
+{
+ my $o = shift;
+ return join('-', $o->{stem}, '*', @{$o->{flavors}});
+}
+
+package OpenBSD::Search::Stem;
sub new
{
my ($class, $stem) = @_;
@@ -327,14 +341,8 @@ sub match
return $o->stemlist->find($self->{stem});
}
-package OpenBSD::PackageName::PartialStem;
-our @ISA=(qw(OpenBSD::PackageName::Stem));
-
-sub to_pattern
-{
- my $o = shift;
- return '*.'.$o->{stem}.'*-*';
-}
+package OpenBSD::Search::PartialStem;
+our @ISA=(qw(OpenBSD::Search::Stem));
sub match
{
@@ -342,17 +350,4 @@ sub match
return $o->stemlist->find_partial($self->{stem});
}
-package OpenBSD::PackageName::Name;
-sub to_string
-{
- my $o = shift;
- return join('-', $o->{stem}, $o->{version}->to_string, @{$o->{flavors}});
-}
-
-sub to_pattern
-{
- my $o = shift;
- return join('-', $o->{stem}, '*', @{$o->{flavors}});
-}
-
1;