04-09-2013 04:49 AM
Hi dear All.
Problem is as follows.
I have to create script that will check few our machines for list of patches , that have to be installed on them.
There is no any problem to check if some specific patch(let us say - PHSS_39821) is installed:
you just perform
swlist -l product
and grep through its results.
But those patch can be part of some patches bundle(let us call it "X"). In such a case - such simple test will not work. I will get result that patch is not installed, while actually - it is. Since Bundle "X" is installed on my machine... Is there some intelligent way to work out those situation? How can I check if some bundle - among those, installed on my machine includes some specific patch (for example - PHSS_39821, but in fact - it can be any other patch...)??
Solved! Go to Solution.
04-09-2013 05:31 AM
When you run "swlist" without options, it lists first all bundles, then all products that are not contained in any bundle. This listing has the problem you described.
But when you use "swlist -l product", it lists all product-level software objects, whether they are contained in a bundle or not.
This HP-UX 11.31 system contains patch 37296. If try to grep it from the plain "swlist" output, I don't see it:
# swlist |grep 37296 #
But if I use "swlist -l product", I see it just fine:
# swlist -l product |grep 37296 PHKL_37296 1.0 vfs module patch #
So there should be no problem at all in detecting patches within bundles as you use "swlist -l product".
If I want to list products within a particular bundle only (e.g. QPKBASE, the standard base OS bundle of a 11.31 Quality Pack), I can do this:
# swlist -l product QPKBASE |grep 37296 QPKBASE.PHKL_37296 1.0 vfs module patch #
This confirms the patch PHKL_37296 is indeed within the QPKBASE bundle.
You can drill even deeper - for example, to the fileset level:
# swlist -l fileset |grep 37296 # PHKL_37296 1.0 vfs module patch PHKL_37296.CORE2-KRN 1.0 OS-Core.CORE2-KRN #
Or even down to individual files:
# swlist -l file |grep 37296 # PHKL_37296 1.0 vfs module patch # PHKL_37296.CORE2-KRN 1.0 OS-Core.CORE2-KRN PHKL_37296.CORE2-KRN: /usr/conf/mod/vfs #
04-09-2013 06:35 AM
Firs - thanks a lot for your reply.
So - you says, that "-l product" have to fully cover my requirment. That means - if patch "Y" is installed in some way (as stand alone patch, or - as a part of some bundle) I will find it in output of:
swlist -l product
Am I right?
04-09-2013 06:58 AM
Why not use 'swlist -l patch' to list the patches installed?
If you want to include superseded patches you can do:
swlist -l patch -x show_superseded_patches=true
04-09-2013 11:20 AM
>includes some specific patch (for example - PHSS_39821
If you want to check for a specific patch you can just list it:
swlist -l patch PHSS_39821
04-09-2013 11:49 PM
Thank every one for replys.
I just thought, that swlist command can not go into patch bundles and shows me only patches - that was installed as "stand alone" patches, and not as part of bundle...Patrick. Thanks for "show_superseded_patches" option. In my case it can be of great help...I did not know that it exists...