== What I know about the _patchdiag.xref_ format The [[_patchdiag.xref_ file /blog/solaris/EasierPatchManagement]] is the patch index file used by various tools, Sun and otherwise, such as the marvelous [[pca /Software/pca]]. Here's what I've worked out about its format, much of which comes from reading [[pca]]'s source code. Any line starting with a '_#_' is a comment. In practice, they seem to come only at the start of the file and start with '_##_', but I wouldn't count on that. Each patch is one line, with fields separated by '_|_', and *appears* to be ordered by increasing patch number, although I wouldn't count on that. The fields are, in order: |_. _id_ | patch ID, usually a six-digit number | _rev_ | the patch's revision, usually a two-digit number | _date_ | the issue date of the patch, as Mon/DD/YY. | _rflag_ | '_R_' if the patch is a recommended patch | _sflag_ | '_S_' if the patch is a security patch | _oflag_ | '_O_' if the patch is obsolete | _byflag_ | The first character is '_Y_' if this is a Y2K patch. The second character is '_B_' if this is a bad patch. | _os_ | applicable operating system version, or '_Unbundled_' for just stuff. | _archs_ | the machine architectures that the patch is for, plus prerequisite patches. | _pkgs_ | the packages that this patch affects/requires, plus incompatible patches. | _synopsis_ | Human readable (hopefully) patch synopsis. The _os_ field also sometimes bundles the architecture in, so you will see things like an OS of '((8_x86))' for Solaris 8 on x86, versus just '_8_' for Solaris 8 SPARC. The _archs_ and _pkgs_ fields contains subvalues; each subvalue ends with a '_;_', even if it is the last (or the only) subvalue in the field. (This helpfully mucks up pretty much any language's 'split' function; you get to split and then throw away the last element.) Any prerequisite patches are encoded in the _archs_ field, as _id-rev_ values. Incompatible patches are slapped into the _pkgs_ field in the same format. If a patch has been obsoleted by something, its _synopsis_ says so. There are a number of slightly varied formats that this information can be in. The subvalues in the _pkgs_ field (apart from incompatible patches) are in the format 'PKG:REV', with REV in the same form that '_pkginfo -x_' produces it (more or less, it looks like). The subvalues in the _archs_ field (apart from prerequisite patches) may be an architecture name ('sparc' or 'i386'), '_all_', or '.' such as 'sparc.sun4u'. [[Pca /Software/pca]]'s matching code accepts a patch if any of the subvalues match, and you'll frequently see 'redundant' _archs_ values like 'sparc;sparc.sun4u;'.