summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Dependencies.pm8
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackageName.pm6
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackageRepository/Installed.pm6
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackingElement.pm6
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PkgCfl.pm4
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PkgSpec.pm6
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Replace.pm6
-rw-r--r--usr.sbin/pkg_add/pkg6
-rw-r--r--usr.sbin/pkg_add/pkg_add4
-rw-r--r--usr.sbin/pkg_add/pkg_info4
10 files changed, 30 insertions, 26 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Dependencies.pm b/usr.sbin/pkg_add/OpenBSD/Dependencies.pm
index 435c5897eec..46cf895a348 100644
--- a/usr.sbin/pkg_add/OpenBSD/Dependencies.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Dependencies.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Dependencies.pm,v 1.23 2007/05/14 09:49:27 espie Exp $
+# $OpenBSD: Dependencies.pm,v 1.24 2007/05/14 10:43:45 espie Exp $
#
# Copyright (c) 2005-2007 Marc Espie <espie@openbsd.org>
#
@@ -29,7 +29,7 @@ use OpenBSD::Interactive;
sub find_candidate
{
my $spec = shift;
- my @candidates = $spec->match(@_);
+ my @candidates = $spec->match_list(@_);
if (@candidates >= 1) {
return $candidates[0];
} else {
@@ -137,7 +137,9 @@ sub find_old_lib
my ($state, $base, $pattern, $lib, $dependencies) = @_;
my $spec = OpenBSD::PkgSpec->new(".libs-".$pattern);
- for my $try ($spec->match(installed_packages())) {
+ require OpenBSD::PackageRepository::Installed;
+
+ for my $try (OpenBSD::PackageRepository::Installed->new->match($spec)) {
OpenBSD::SharedLibs::add_package_libs($try);
if (check_lib_spec($base, $lib, {$try => 1})) {
$dependencies->{$try} = 1;
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageName.pm b/usr.sbin/pkg_add/OpenBSD/PackageName.pm
index e9c10232a1c..1ceabd06aab 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.23 2007/05/14 10:00:08 espie Exp $
+# $OpenBSD: PackageName.pm,v 1.24 2007/05/14 10:43:45 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -321,7 +321,7 @@ sub split
return $class->new(OpenBSD::PackageName::splitstem($pkgname));
}
-sub match_repo
+sub match
{
my ($self, $o) = @_;
return $o->stemlist->find($self->{stem});
@@ -336,7 +336,7 @@ sub to_pattern
return '*.'.$o->{stem}.'*-*';
}
-sub match_repo
+sub match
{
my ($self, $o) = @_;
return $o->stemlist->find_partial($self->{stem});
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageRepository/Installed.pm b/usr.sbin/pkg_add/OpenBSD/PackageRepository/Installed.pm
index b621d71a77c..2aa06cf45f0 100644
--- a/usr.sbin/pkg_add/OpenBSD/PackageRepository/Installed.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PackageRepository/Installed.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Installed.pm,v 1.3 2007/05/14 10:24:58 espie Exp $
+# $OpenBSD: Installed.pm,v 1.4 2007/05/14 10:43:45 espie Exp $
#
# Copyright (c) 2007 Marc Espie <espie@openbsd.org>
#
@@ -30,9 +30,9 @@ sub match
{
my ($self, $search, $filter) = @_;
if (defined $filter) {
- return &$filter($search->match_repo($self));
+ return &$filter($search->match($self));
} else {
- return $search->match_repo($self);
+ return $search->match($self);
}
}
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
index aae57ff8000..679d83857ea 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.106 2007/05/13 10:08:11 espie Exp $
+# $OpenBSD: PackingElement.pm,v 1.107 2007/05/14 10:43:45 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -740,8 +740,10 @@ sub add
my ($class, $plist, $args) = @_;
require OpenBSD::PkgSpec;
+ require OpenBSD::PackageRepository::Installed;
- my @candidates = OpenBSD::PkgSpec->new($args)->match(installed_packages());
+ my @candidates = OpenBSD::PackageRepository::Installed->new
+ ->match(OpenBSD::PkgSpec->new($args));
if (@candidates == 1) {
if (!defined $installed_modules->{$candidates[0]}) {
# pull in the module right here and now;
diff --git a/usr.sbin/pkg_add/OpenBSD/PkgCfl.pm b/usr.sbin/pkg_add/OpenBSD/PkgCfl.pm
index 1e9ef79fb95..af63362c251 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.18 2007/05/12 14:48:45 espie Exp $
+# $OpenBSD: PkgCfl.pm,v 1.19 2007/05/14 10:43:45 espie Exp $
#
# Copyright (c) 2003-2005 Marc Espie <espie@openbsd.org>
#
@@ -54,7 +54,7 @@ sub conflicts_with
my ($self, @pkgnames) = @_;
my @l = ();
for my $cfl (@$self) {
- push(@l, $cfl->match(@pkgnames));
+ push(@l, $cfl->match_list(@pkgnames));
}
return @l;
}
diff --git a/usr.sbin/pkg_add/OpenBSD/PkgSpec.pm b/usr.sbin/pkg_add/OpenBSD/PkgSpec.pm
index c8009f7fb92..2b4cd2badc1 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.9 2007/05/13 12:55:54 espie Exp $
+# $OpenBSD: PkgSpec.pm,v 1.10 2007/05/14 10:43:45 espie Exp $
#
# Copyright (c) 2003-2005 Marc Espie <espie@openbsd.org>
#
@@ -217,13 +217,13 @@ sub match_ref
return @l;
}
-sub match_repo
+sub match
{
my ($self, $o) = @_;
return $self->match_ref($o->list);
}
-sub match
+sub match_list
{
my ($self, @list) = @_;
return $self->match_ref(\@list);
diff --git a/usr.sbin/pkg_add/OpenBSD/Replace.pm b/usr.sbin/pkg_add/OpenBSD/Replace.pm
index cfffe49942a..1a25b358c2b 100644
--- a/usr.sbin/pkg_add/OpenBSD/Replace.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Replace.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Replace.pm,v 1.10 2007/05/12 22:50:31 espie Exp $
+# $OpenBSD: Replace.pm,v 1.11 2007/05/14 10:43:45 espie Exp $
#
# Copyright (c) 2004-2006 Marc Espie <espie@openbsd.org>
#
@@ -159,9 +159,9 @@ sub check_replacement_spec
my ($self, $state, $wanting, $toreplace, $replacement) = @_;
# nothing to validate if old dependency doesn't concern us.
- return unless $self->spec->match($toreplace);
+ return unless $self->spec->match_list($toreplace);
# nothing to do if new dependency just matches
- return if $self->spec->match($replacement);
+ return if $self->spec->match_list($replacement);
if ($state->{forced}->{updatedepends}) {
Warn "Forward dependency of $wanting on $toreplace doesn't match $replacement, forcing it\n";
diff --git a/usr.sbin/pkg_add/pkg b/usr.sbin/pkg_add/pkg
index 843aa9143e0..e65b3f8fd9f 100644
--- a/usr.sbin/pkg_add/pkg
+++ b/usr.sbin/pkg_add/pkg
@@ -1,6 +1,6 @@
#! /usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: pkg,v 1.5 2007/05/14 10:27:46 espie Exp $
+# $OpenBSD: pkg,v 1.6 2007/05/14 10:43:45 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -25,8 +25,8 @@ sub check_dependencies($)
require OpenBSD::PkgSpec;
require OpenBSD::PackageRepository::Installed;
my $dependency = shift;
- my @m = OpenBSD::PkgSpec->new($dependency)
- ->match_repo(OpenBSD::PackageRepository::Installed->new);
+ my @m = OpenBSD::PackageRepository::Installed->new
+ ->match(OpenBSD::PkgSpec->new($dependency));
return (@m != 0) ? 1 : 0;
}
diff --git a/usr.sbin/pkg_add/pkg_add b/usr.sbin/pkg_add/pkg_add
index 68fd75e55fe..0894dd90346 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.241 2007/05/14 09:49:27 espie Exp $
+# $OpenBSD: pkg_add,v 1.242 2007/05/14 10:43:45 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -331,7 +331,7 @@ sub really_add($$)
for my $op (@toreplace) {
OpenBSD::ProgressMeter::set_header($op->pkgname." (deleting)");
$state->set_pkgname($op->pkgname);
- if (OpenBSD::PkgSpec->new("mozilla-thunderbird-<=1.0.2p0")->match($op->pkgname)) {
+ if (OpenBSD::PkgSpec->new("mozilla-thunderbird-<=1.0.2p0")->match_list($op->pkgname)) {
thunderbird_special_case($plist);
}
require OpenBSD::Delete;
diff --git a/usr.sbin/pkg_add/pkg_info b/usr.sbin/pkg_add/pkg_info
index 7224747828e..409493f087a 100644
--- a/usr.sbin/pkg_add/pkg_info
+++ b/usr.sbin/pkg_add/pkg_info
@@ -1,6 +1,6 @@
#! /usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: pkg_info,v 1.51 2007/05/14 10:27:46 espie Exp $
+# $OpenBSD: pkg_info,v 1.52 2007/05/14 10:43:45 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -142,7 +142,7 @@ sub find_by_spec
require OpenBSD::PkgSpec;
require OpenBSD::PackageRepository::Installed;
- return sort(OpenBSD::PkgSpec->new($pat)->match_repo(OpenBSD::PackageRepository::Installed->new));
+ return sort(OpenBSD::PackageRepository::Installed->new->match(OpenBSD::PkgSpec->new($pat)));
}
sub filter_files