|-c catalog||Use catalog as the catalog file. If not specified, the catalog defaults to /usr/local/share/xml/catalog.ports if running in XML mode, or to /usr/local/share/sgml/catalog.ports if running in SGML mode (see the -s flag).|
|-h||Show a descriptive usage message and exit.|
|-p||When adding a new entry to a catalog (using the add action), prepend it instead of inserting it at the end.|
|-s||Use the standard SGML catalog format to parse the catalog, instead of the XML format.|
|-v||Show version information and exit.|
The action argument specifies what to do with the catalog file. It is mandatory and may require extra arguments. The action name can be preceded by the -- string, to maintain some compatibility with the xmlcatalog utility included in the libxml2 package.
The following actions are available:
|add type orig replace||
Add an entry to the catalog.
specifies the type of entry (see below),
is the public identifier to be replaced and
is the system URI used to do the replacement.
If replace is the -- string, it is ignored. This is specially useful in scripts, as you can parse three arguments at a time regardless the current type expectations.
If all entries can be added successfully, the program returns 0; otherwise Gt]0.
|create||Create an empty catalog. Produces an error if it already exists.|
|destroy||Delete the catalog file.|
Check if given entries exist in the catalog, specified by their
This matches the value passed to
when using the
All entries found are printed to standard output.
Note that this action does not recurse into catalogs, nor does network lookups. It is only provided to check if entries exist in an specific catalog, to decide if they should be registered or not.
If all entries exist, the program returns 0; otherwise Gt]0.
|remove type value||
Remove entries from the catalog, specified by their
The former provides the type of entry (see below), while the later matches
the value passed in the
parameter when using the
If just one argument is provided, all matching entries are removed, regardless their type. This is only provided for command line compatibility with all previous versions, so do not use it any more (a warning message will be shown).
If all entries were removed successfully, the program returns 0; otherwise Gt]0.
When parsing SGML catalogs, the type used by add and remove actions can be one of the following: BASE, CATALOG, DELEGATE, DOCTYPE, DOCUMENT, ENTITY, LINKTYPE, NOTATION, OVERRIDE, PUBLIC, SGMLDECL and SYSTEM. When parsing XML catalogs, it can be: delegatePublic, delegateSystem, delegateURI, group (not supported), nextCatalog, public, rewriteSystem, rewriteURI, system and uri.
- http://www.jclark.com/sp/catalog.htm - Quick introduction to the SGML catalog format.
- http://www.oasis-open.org/committees/entity/spec.html - Full reference of the XML catalog format.
- http://www.xmlsoft.org/ - libxml2 homepage.
- http://xmlcatmgr.sourceforge.net/ - xmlcatmgr homepage.
xmlcatmgr was created because the
.Nx Packages Collection needed a very small catalog manager to automatically (un)register catalog entries when (de)installing packages.
It was released as an independant program through Sourceforge in the hope that it is useful to more people.
For a list of changes between versions, see: /usr/local/share/doc/xmlcatmgr/CHANGES.
The xmlcatmgr utility was written by
.An Julio M. Merino Vidal <email@example.com>.