#! /usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: PkgInfo.pm,v 1.38 2016/06/22 12:18:21 espie Exp $
+# $OpenBSD: PkgInfo.pm,v 1.39 2016/06/28 15:38:36 espie Exp $
#
# Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org>
#
return;
}
my $plist;
- if ($state->opt('I')) {
+ if ($state->opt('z')) {
+ $plist = $handle->plist(\&OpenBSD::PackingList::ExtraInfoOnly);
+ my $name = OpenBSD::PackageName->new_from_string($pkg);
+ my $stem = $name->{stem};
+ my $compose = $stem."--".join('-', sort keys %{$name->{flavors}});
+ if ($plist->has('is-branch')) {
+ if ($plist->fullpkgpath =~ m/\/([^\/]+?)(,.*)?$/) {
+ $compose .= "%$1";
+ }
+ }
+ $state->say("#1", $compose);
+ } elsif ($state->opt('I')) {
if ($state->opt('q')) {
$state->say("#1", $pkg);
} else {
}
};
$state->{no_exports} = 1;
- $state->handle_options('cCdfF:hIKLmPQ:qr:RsSUe:E:Ml:aAt',
- '[-AaCcdfIKLMmPqRSstUv] [-D nolock][-E filename] [-e pkg-name] ',
+ $state->handle_options('cCdfF:hIKLmPQ:qr:RsSUe:E:Ml:aAtz',
+ '[-AaCcdfIKLMmPqRSstUvz] [-D nolock][-E filename] [-e pkg-name] ',
'[-l str] [-Q query] [-r pkgspec] [pkg-name ...]');
if ($state->opt('r')) {
-.\" $OpenBSD: pkg_info.1,v 1.52 2016/02/29 22:59:33 jmc Exp $
+.\" $OpenBSD: pkg_info.1,v 1.53 2016/06/28 15:38:36 espie Exp $
.\"
.\" Documentation and design originally from FreeBSD. All the code has
.\" been rewritten since. We keep the documentation's notice:
.\" Jordan K. Hubbard
.\"
.\"
-.Dd $Mdocdate: February 29 2016 $
+.Dd $Mdocdate: June 28 2016 $
.Dt PKG_INFO 1
.Os
.Sh NAME
.Sh SYNOPSIS
.Nm pkg_info
.Bk -words
-.Op Fl AaCcdfIKLMmPqRSstUv
+.Op Fl AaCcdfIKLMmPqRSstUvz
.Op Fl E Ar filename
.Op Fl e Ar pkg-name
.Op Fl l Ar str
Show the deinstall-message file (if any) for each package.
.It Fl v
Turn on verbose output.
+.It Fl z
+Fuzzy listing option, often used together with
+.Fl m .
+Only shows stems, flavors and branches information.
+To be reused with
+.Xr pkg_add 1
+.Fl l
+to recreate a package installation with different versions and no ambiguity.
.El
.Sh ENVIRONMENT
.Bl -tag -width PKG_TMPDIR