diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2004-11-11 11:54:10 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2004-11-11 11:54:10 +0000 |
commit | c19db1f9271c336beedc007ce8ee0e6695416159 (patch) | |
tree | c7d23392a563b53bfef0c00b84d48653a4310c2b /usr.sbin | |
parent | b842578bc80b961af0f55d2a6ad7c1dab12e1191 (diff) |
package names starting with . are hidden from pkg_info by default.
-A shows them.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackageInfo.pm | 10 | ||||
-rw-r--r-- | usr.sbin/pkg_add/pkg_info | 12 | ||||
-rw-r--r-- | usr.sbin/pkg_add/pkg_info.1 | 7 |
3 files changed, 18 insertions, 11 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageInfo.pm b/usr.sbin/pkg_add/OpenBSD/PackageInfo.pm index 84eec22a902..75b674be01c 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackageInfo.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackageInfo.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: PackageInfo.pm,v 1.10 2004/11/11 11:16:39 espie Exp $ +# $OpenBSD: PackageInfo.pm,v 1.11 2004/11/11 11:54:09 espie Exp $ # # Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org> # @@ -70,7 +70,7 @@ sub delete_installed } } -sub installed_packages() +sub installed_packages(;$) { if (!defined $list) { $list = {}; @@ -95,7 +95,11 @@ sub installed_packages() print "Warning: can't access information for ", join(", ", @bad), "\n"; } } - return keys %$list; + if ($_[0]) { + return grep { !/^\./ } keys %$list; + } else { + return keys %$list; + } } sub installed_info($) diff --git a/usr.sbin/pkg_add/pkg_info b/usr.sbin/pkg_add/pkg_info index 2e3df805667..5a340fa23ae 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.16 2004/11/11 11:24:15 espie Exp $ +# $OpenBSD: pkg_info,v 1.17 2004/11/11 11:54:09 espie Exp $ # # Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org> # @@ -83,7 +83,7 @@ sub find_by_path our ($opt_c, $opt_D, $opt_d, $opt_f, $opt_I, $opt_i, $opt_k, $opt_L, $opt_m, $opt_p, $opt_q, $opt_R, $opt_r, $opt_s, $opt_v, $opt_h, $opt_l, - $opt_a, $opt_M, $opt_U); + $opt_a, $opt_M, $opt_U, $opt_A); my $terse = 0; my $exit_code = 0; @@ -185,7 +185,7 @@ sub print_info } } -getopts('cDdfIikLmpqRrsvhe:MU:l:a', +getopts('cDdfIikLmpqRrsvhe:MU:l:aA', {'e' => sub { my $pat = shift; @@ -225,16 +225,16 @@ if (!defined $opt_p) { $opt_p = ""; } -if (@ARGV == 0 && !$opt_a) { +if (@ARGV == 0 && !$opt_a && !$opt_A) { die "Missing package name(s)"; } -if (@ARGV > 0 && $opt_a) { +if (@ARGV > 0 && ($opt_a || $opt_A)) { die "Can't specify package name(s) with -a"; } if (@ARGV == 0) { - @ARGV = sort(installed_packages()); + @ARGV = sort(installed_packages(defined $opt_A ? 0 : 1)); } for my $pkg (@ARGV) { diff --git a/usr.sbin/pkg_add/pkg_info.1 b/usr.sbin/pkg_add/pkg_info.1 index 84627954baf..62ee1f7191f 100644 --- a/usr.sbin/pkg_add/pkg_info.1 +++ b/usr.sbin/pkg_add/pkg_info.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: pkg_info.1,v 1.7 2004/11/10 09:55:43 espie Exp $ +.\" $OpenBSD: pkg_info.1,v 1.8 2004/11/11 11:54:09 espie Exp $ .\" .\" FreeBSD install - a package for the installation and maintenance .\" of non-core utilities. @@ -30,7 +30,7 @@ .Op Fl l Ar prefix .Ar pkg-name Op Ar ... .Nm pkg_info -.Op Fl a Ar flags +.Op Fl aA Ar flags .Sh DESCRIPTION The .Nm @@ -54,6 +54,9 @@ The following command-line options are supported: .Bl -tag -width indent .It Fl a Show information for all currently installed packages. +.It Fl A +Show information for all currently installed packages, +including internal packages. .It Fl c Show the one-line comment field for each package. .It Fl D |