diff options
author | Bernd Ahlers <bernd@cvs.openbsd.org> | 2005-11-01 17:02:30 +0000 |
---|---|---|
committer | Bernd Ahlers <bernd@cvs.openbsd.org> | 2005-11-01 17:02:30 +0000 |
commit | 05c11be562ecffa025c89e7aa7cbbb309c1e7875 (patch) | |
tree | ec871179058d49e424f54dc5db0072f4edec154f | |
parent | 00ea89f7b42ca780e837db36cf74c4f202d32b80 (diff) |
Add -P option. This shows the pkgpath for each package. Nice for building
subdirlists.
Document new option.
"commit" espie@
-rw-r--r-- | usr.sbin/pkg_add/pkg_info | 18 | ||||
-rw-r--r-- | usr.sbin/pkg_add/pkg_info.1 | 7 |
2 files changed, 18 insertions, 7 deletions
diff --git a/usr.sbin/pkg_add/pkg_info b/usr.sbin/pkg_add/pkg_info index 96230b3f827..6706220fc5e 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.36 2005/10/28 20:16:13 espie Exp $ +# $OpenBSD: pkg_info,v 1.37 2005/11/01 17:02:29 bernd Exp $ # # Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org> # @@ -207,7 +207,7 @@ sub find_by_path our ($opt_c, $opt_D, $opt_d, $opt_f, $opt_I, $opt_i, $opt_k, $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_S); + $opt_a, $opt_M, $opt_U, $opt_A, $opt_S, $opt_P); my $terse = 0; my $exit_code = 0; my $error_e = 0; @@ -298,6 +298,14 @@ sub print_info print "Signature: " unless $opt_q; print $plist->signature(), "\n"; } + if ($opt_P) { + require OpenBSD::PackingList; + + my $plist = OpenBSD::PackingList->from_installation( + $pkg, \&OpenBSD::PackingList::ExtraInfoOnly); + print "Pkgpath:\n" unless $opt_q; + print $plist->{extrainfo}->{subdir}, "\n"; + } if ($opt_f) { print $opt_l, "Packing list:\n" unless $opt_q; @@ -308,11 +316,11 @@ sub print_info } } -set_usage('pkg_info [-cDdfIiKkLMpqRrSsUv] [-E filename] [-e pkg-name] [-l str] pkg-name [...]', 'pkg_info [-Aa flags]'); +set_usage('pkg_info [-cDdfIiKkLMPpqRrSsUv] [-E filename] [-e pkg-name] [-l str] pkg-name [...]', 'pkg_info [-Aa flags]'); my $locked; try { - getopts('cDdfhIikKLmpqRrsSUve:E:Ml:aA', + getopts('cDdfhIikKLmpPqRrsSUve:E:Ml:aA', {'e' => sub { my $pat = shift; @@ -352,7 +360,7 @@ if ($opt_D) { unless ($opt_c || $opt_M || $opt_U || $opt_d || $opt_f || $opt_I || $opt_i || $opt_k || $opt_L || $opt_m || $opt_p || $opt_R || $opt_r || $opt_s || - $opt_S || $terse) { + $opt_S || $opt_P || $terse) { if (@ARGV == 0) { $opt_I = $opt_a = 1; } else { diff --git a/usr.sbin/pkg_add/pkg_info.1 b/usr.sbin/pkg_add/pkg_info.1 index 51365a184e6..a050f199d8b 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.19 2005/10/10 09:38:29 espie Exp $ +.\" $OpenBSD: pkg_info.1,v 1.20 2005/11/01 17:02:29 bernd Exp $ .\" .\" FreeBSD install - a package for the installation and maintenance .\" of non-core utilities. @@ -26,7 +26,7 @@ .Sh SYNOPSIS .Nm pkg_info .Bk -words -.Op Fl cDdfIiKkLMpqRrSsUv +.Op Fl cDdfIiKkLMPpqRrSsUv .Op Fl E Ar filename .Op Fl e Ar pkg-name .Op Fl l Ar str @@ -139,6 +139,9 @@ organize it. This lets you add a special token to the start of each field. .It Fl M Show the install-message file (if any) for each package. +.It Fl P +Show the pkgpath for each package. +You can easily build a subdirlist with this. .It Fl p Show the installation prefix for each package. .It Fl q |