summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/pkg_info
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2007-05-07 14:06:39 +0000
committerMarc Espie <espie@cvs.openbsd.org>2007-05-07 14:06:39 +0000
commit62caeed99c136e6c767c728e1af4de73df3d9f76 (patch)
tree57746ce92fe6cdcb0f9dcaa77c05f46defb11863 /usr.sbin/pkg_add/pkg_info
parentb7c1eafb0a947b4c2c72a99187851ec8c81d3915 (diff)
do not expose stemlist internals, create find_partialstem function.
Diffstat (limited to 'usr.sbin/pkg_add/pkg_info')
-rw-r--r--usr.sbin/pkg_add/pkg_info14
1 files changed, 3 insertions, 11 deletions
diff --git a/usr.sbin/pkg_add/pkg_info b/usr.sbin/pkg_add/pkg_info
index 6a49b046eb3..4a00ca14510 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.45 2007/05/02 13:59:19 espie Exp $
+# $OpenBSD: pkg_info,v 1.46 2007/05/07 14:06:38 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -371,16 +371,8 @@ if ($opt_Q) {
my $stemlist = OpenBSD::PackageName::available_stems();
print "PKG_PATH=$ENV{PKG_PATH}\n" if $opt_v;
- for my $stem (sort keys %$stemlist) {
- if ($stem =~ /\Q$opt_Q\E/i) {
- for my $p (keys %{$stemlist->{$stem}}) {
- my $text = "$p";
- if (is_installed($p)) {
- $text .= " (installed)";
- }
- print $text."\n";
- }
- }
+ for my $p (sort $stemlist->find_partialstem($opt_Q)) {
+ print $p, is_installed($p) ? " (installed)" : "" , "\n";
}
exit 0;