Catalog Format

This page describes the catalog format.

common version package file md5 size dependencies category

Example:

bind 9.4.2,REV=2008.07.09_rev=p1 CSWbind bind-9.4.2,REV=2008.07.09_rev=p1-SunOS5.8-sparc-CSW.pkg.gz f68df57fcf54bfd37304b79d6f7eeacc 2954112 CSWcommon|CSWosslrt net

Each field is space separated, the dependencies field can be split with the pipe char, like in the example above with two dependencies. The same goes for the category field.

Here's a list of approved categories: http://www.opencsw.org/standards/categories.

A package can only occur once in the catalog.

The catalog may have to be extended to support more features like if there's a source package available. In that case extra fields should be added to the end so not to break existing tools.

Build your own catalogs

If you have test packages that you have built for OpenCSW or your very own packages that have dependencies to each other you may want to use pkgutil to install them. For that to work you need a catalog for your packages just like the ones OpenCSW publishes.

There's now a simple perl script to parse your packages in a directory and build a catalog for them. The one argument is the directory to parse for *.pkg.gz files and stdout is used so use normal redirection for the catalog.

Note that to create a CSW catalog you need to follow the guidelines on how to name and version packages, see http://www.opencsw.org/standards/build#versioning.

$ bldcat .
xv 3.10a,REV=2008.10.15 CSWxv xv-3.10a,REV=2008.10.15-SunOS5.8-sparc-CSW.pkg.gz d887c7aed0e849471467e4944d14c2eb 1877768 CSWcommon|CSWtiff|CSWpng|CSWjpeg|CSWzlib none
$ bldcat . > catalog
$ ls -l
-rw-r--r--   1 bonivart csw          167 Oct 22 17:19 catalog
-rw-r--r--   1 bonivart csw      1877768 Oct 22 17:19 xv-3.10a,REV=2008.10.15-SunOS5.8-sparc-CSW.pkg.gz
$ more catalog
xv 3.10a,REV=2008.10.15 CSWxv xv-3.10a,REV=2008.10.15-SunOS5.8-sparc-CSW.pkg.gz d887c7aed0e849471467e4944d14c2eb 1877768 CSWcommon|CSWtiff|CSWpng|CSWjpeg|CSWzlib none

The script is a part of the official pkgutil package.

Check the catalog

There's also a simple check that the catalog is correct. It checks that every line is eight fields and that the dependency and category fields begin and end with chars. It also warns if packages are not compressed (normal for gzip and pkg-get). It also checks for duplicates.

Test run on a manipulated catalog:

# chkcat /var/opt/csw/pkgutil/catalog 
Skipping signature.
Skipping comment.
Skipping comment.
Skipping comment.

ERROR! 7 fields instead of normal 8.
2.2.4,REV=2008.10.01 CSWlibtoolrt libtool_rt-2.2.4,REV=2008.10.01-SunOS5.8-sparc-CSW.pkg.gz 72ae2f64521df6e18b7d665bbf11e984 82427 CSWisaexec|CSWcommon none

ERROR! 7 fields instead of normal 8.
rubydoc 1.8.7,REV=2008.09.19_p72 CSWrubydoc rubydoc-1.8.7,REV=2008.09.19_p72-SunOS5.8-i386-CSW.pkg.gz d47700240d7c675e5f843b03a937c28e 3032323 none

WARNING! Package CSWrubytk is not compressed.
rubytk 1.8.7,REV=2008.09.19_p72 CSWrubytk rubytk-1.8.7,REV=2008.09.19_p72-SunOS5.8-i386-CSW.pkg 2215ac92175922c593245ef577e92fc9 317259 CSWruby|CSWtcl|CSWtk|CSWcommon none

ERROR! The category field of package CSWspamassassin begins with a non-char.
spamassassin 3.2.5,REV=2008.10.21 CSWspamassassin spamassassin-3.2.5,REV=2008.10.21-SunOS5.8-i386-CSW.pkg.gz e5bd858be4a67023b02ee1e5e760295b 896877 CSWosslrt|CSWperl|CSWpmarchivetar|CSWpmdbi|CSWpmdigestsha1|CSWpmiosocketinet6|CSWpmiosocketssl|CSWpmiozlib|CSWpmipcountry|CSWpmldap|CSWpmlibwww|CSWpmmaildkim|CSWpmmailspf|CSWpmmailtools|CSWpmmimebase64|CSWpmnetdns|CSWpmuri|CSWpmhtmlparser|CSWzlib|CSWcommon +none

ERROR! The dependency field of package CSWxv ends with a pipe char.
xv 3.10a,REV=2008.10.17 CSWxv xv-3.10a,REV=2008.10.17-SunOS5.8-i386-CSW.pkg.gz 9de3c40048fc8c9f79616ee388fc98f1 1731846 CSWcommon|CSWtiff|CSWpng|CSWjpeg|CSWzlib| none

Skipping signature. Exiting.

The script is a part of the official pkgutil package.

page_revision: 22, last_edited: 1228007592|%e %b %Y, %H:%M %Z (%O ago)
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License