I discovered this little gem today. Patchadd on Solaris 10 and later has an undocumented and little known -a flag that allows you to perform a dry run to see if a patch would install.

Here's a little demo using the now vital in.telnetd patch:


[devon : /var/tmp/]# patchadd -a 120068-02
Validating patches...

Loading patches installed on the system...

Done!

Loading patches requested to install.

Done!

Checking patches that you specified for installation.

Done!
System patches
117461-08 118367-02 118371-06 118373-01 118812-01 118868-01 118872-02 118918-09

... [ Truncated for brevity ] ...

Dry run exit.

[devon : /var/tmp/]#

Looks just like the output you get when you normally apply patches, except for the long list of patches at the end. My only (minor) criticism of this is it doesn't do the filesystem space check. I didn't specify the -d option, so I'd expect the space check to be run.

Unfortunately, earlier releases don't have this, but there's nothing stopping you from adding this functionality by modifying the /usr/lib/patch/patchadd script. It won't be supported of course ;-) .