Check that supersede of package version is installed

I need a programmatic way to check, that supersede of required package is installed. At Linux I do it using rpmvercm utility to compare installed package version to my minimal requirement.
So - I need analog of Linux "rpmvercm" utility for Solaris (10/11)
Let us say - I know that minimal version of system/library package (solaris 11) that I need to be installed is "0.5.11"
Is there some utility, that will automatically compare installed version (for example 0.5.12) and required and give me status - if I need to update my package?

Do you mean rpmdev-vercmp ?

Yes. At Linux platforms it works quite good. But I do not success to find some analog for Solaris. Actually I even do not use utility itself , but I incorporated its C code in my project...
Now I need to solve same problem for Solaris... Funny thing is that actually there is implementation of rpm for Solaris. And at machines with installed rpm manager I can use same code... But obviousely - it will not work at Solaris machine , that has not RPM manager installed.

You may want to look at PCA tool. I use this for solaris patch reporting and patching servers. Its a great tool to compare patches, patching servers, downloading the missing patches and tons of other features which makes life easier.

Patch Check Advanced

It seems to be a great tool. But not for my purposes. I do not need to install required packages. I need to check compliance of specific machine to set of pre-requirements (package X with version Y or higher is installed) and output report...

Packaging works differently with Solaris compared to Red Hat, in particular with Solaris 10 where patches, not whole packages, are more commonly used to fix/update existing packages.

You should better explain why you want this functionality in the first place. Is it for custom made packages, third party, system ones ?

It is a part of our installation procedure. I have a list of pre-requirements, supplied by dev teams. And I have to verify them on customer's box , before actually installaing product. So - I have list of x (6-12 depend of platform) packages that have to be present and their minimal versions. There is no problem to check that package X is installed , and query version of it, that is installed. Problem is - how to compare those quered version with minimum I have from development...:slight_smile:

---------- Post updated at 03:15 AM ---------- Previous update was at 03:14 AM ----------

But - if I get it right, after patch is installed - it updates in Solaris "registry" version of package it have been updated... Right?

Can you provide a factual example of a required package and its expected minimal version?

After patching, the version might be unchanged. That's the whole point of patching vs updating, but patching only apply to Solaris OS packages, not for third party/external ones.

Moreover, the whole package system has radically changed between Solaris 10 and Solaris 11.

Ok. For example - I need package libC and patch 119963-26 or higher(Shared library patch for C++). So what I have planned to do is to take machine with those patch installed and take version of SUNWlibC package (5.10 at my machine) there - as minimum...
You says - it will not work? What can work?

There is no ad hoc toll I'm aware of to achieve what you want but its not that complex to implement.

Under Solaris 10, you check if a package is installed with "pkginfo", its version doesn't change when patched. You can check if a patch is installed with "patchadd -p" (will tell you all patches installed). You need to parse patchadd output to make sure the installed patch version, if any, is newer than the one you want. Beware that new patches might have superseded the one you want (they are shown in the "Obsoletes:" field.)

10x. I wll try to implement it this way.