Subject: get pkg_info to output in an easily parsable format
To: None <tech-pkg@netbsd.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: tech-pkg
Date: 03/29/2004 15:23:34
I want pkg_info to give me good details in an easily-parsable format.

I know about the -l switch but it doesn't help.

For example, try:

pkg_info -l "test-" -B -f -c -s -L -d somepackage.tgz

I have some scripts to generate available packages datafile and some
scripts to help tell the user what packages need to be retrieved on an
update. (Once I have an up-to-date and complete datafile, I'll share
this.)

An example of my datafile is:

Name: coreutils-5.0nb3
Prefix: /usr/pkg
Requires: libiconv>=1.9.1 libiconv-1.9.1nb1
Conflicts: sh-utils-*
Conflicts: fileutils-*
Conflicts: textutils-*
Conflicts: id-utils-[0-9]*
Conflicts: gnome-utils<1.4.1.2nb2
Pkgsrc: sysutils/coreutils
Category: sysutils
Comment: GNU basic file, shell and text manipulation utilities
Size: 3051885
Filename: coreutils-5.0nb3.tgz
Filesize: 1027616
Digest: SHA1 ce4e9e647e8635658a59df3bfb8712e607d4f282
OpSys: NetBSD
OsVersion: 1.6.2
Architecture: i386
Format: ELF
License:
Homepage: http://www.gnu.org/software/coreutils/
Description:
The GNU Core Utilities are the basic file, shell and text manipulation
utilities of the GNU operating system. These are the core utilities which
are expected to exist on every operating system.

Previously these utilities were offered as three individual sets of GNU
utilities, fileutils, shellutils, and textutils. Those three have been
combined into a single set of utilities called the coreutils.

   Jeremy C. Reed
   http://bsd.reedmedia.net/