diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2007-05-14 10:27:47 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2007-05-14 10:27:47 +0000 |
commit | bf1d37a0c9f685d8aedfb22b03d9294dc255c482 (patch) | |
tree | 0cb001d7fcd366063ac89faaf53f588b260429ae | |
parent | e3d4985d59c4b03b373e02166f761960c5376cf9 (diff) |
use Repository::Installed a bit more
-rw-r--r-- | usr.sbin/pkg_add/pkg | 7 | ||||
-rw-r--r-- | usr.sbin/pkg_add/pkg_info | 5 |
2 files changed, 7 insertions, 5 deletions
diff --git a/usr.sbin/pkg_add/pkg b/usr.sbin/pkg_add/pkg index eb2d3ee6773..843aa9143e0 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.4 2007/05/12 14:48:45 espie Exp $ +# $OpenBSD: pkg,v 1.5 2007/05/14 10:27:46 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> # @@ -23,9 +23,10 @@ use Getopt::Std; sub check_dependencies($) { require OpenBSD::PkgSpec; - require OpenBSD::PackageInfo; + require OpenBSD::PackageRepository::Installed; my $dependency = shift; - my @m = OpenBSD::PkgSpec->new($dependency)->match(OpenBSD::PackageInfo::installed_packages()); + my @m = OpenBSD::PkgSpec->new($dependency) + ->match_repo(OpenBSD::PackageRepository::Installed->new); return (@m != 0) ? 1 : 0; } diff --git a/usr.sbin/pkg_add/pkg_info b/usr.sbin/pkg_add/pkg_info index fa7f2994d6e..7224747828e 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.50 2007/05/13 13:32:36 espie Exp $ +# $OpenBSD: pkg_info,v 1.51 2007/05/14 10:27:46 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> # @@ -140,8 +140,9 @@ sub find_by_spec my $pat = shift; require OpenBSD::PkgSpec; + require OpenBSD::PackageRepository::Installed; - return sort(OpenBSD::PkgSpec->new($pat)->match(installed_packages())); + return sort(OpenBSD::PkgSpec->new($pat)->match_repo(OpenBSD::PackageRepository::Installed->new)); } sub filter_files |