Ever wished you could get patchadd(1M) to give you the same verbose output pkgadd(1M) does with the -v option? Well believe it or not, you can, it's just not documented.

I was perusing through the /usr/lib/patch/patchadd script on Solaris 10 and look what I found...

function parse_args
{
        [...]
      	-g) PKGADD_DEBUG="yes"; shift;;
        [...]
}

This option isn't documented anywhere, however I do know modifying this script and manually setting this PKGADD_DEBUG variable to yes/true gives you output equivalent to "pkgadd -v" which the pkgadd(1M) man page explains...

     -v

         Trace all of the scripts that get  executed  by  pkgadd,
         located in the pkginst/install directory. This option is
         used for debugging  the  procedural  and  non-procedural
         scripts.

Sure enough, passing the -g option to patchadd(1M) gives us the same output, without having to modify the /usr/lib/patch/patchadd script itself.

I did a bit more investigating and this option has been in this (or equivalent) script since Solaris 8 without any public knowledge of it.

Now this is going to become a very useful option when debugging patches that fail to install where the logs end up being next to useless. I just wish I'd known about it sooner.

WARNING: As this is undocumented, it's completely unsupported and subject to change without notice (no one told us it was there in the first place ;-) ).