I would like to be able to extract (from within a shell script) the attributes of an IPS package. Basically I'm after exact same information as is listed with the pkg info
command, but unfortunately this command list information in a format which is not very friendly to read from within a script. Example below:
$ pkg info archiver/gnu-tar
Name: archiver/gnu-tar
Summary: GNU version of the tar archiving utility
Description: Tar is a program for packaging a set of files as a single
archive in tar format.
Category: Development/GNU
State: Installed
Publisher: solaris
Version: 1.26
Build Release: 5.11
Branch: 0.175.0.0.0.2.537
Packaging Date: October 19, 2011 09:11:16 AM
Size: 1.73 MB
FMRI: pkg://solaris/archiver/gnu-tar@1.26,5.11-0.175.0.0.0.2.537:20111019T091116Z
I was hoping for something like pkg get-property pkg.summary archiver/gnu-tar
to be available as a command but can't find such command. I would really hate to try to parse the above output. Secondly the man pages clearly states that the output from pkg info
is intended to be read by humans, not machines.