Re: How to detect that patch is contained in patch bundle, installed on my machine (427 Views)
Reply
Occasional Visitor
simonovsky_pave
Posts: 3
Registered: ‎04-09-2010
Message 1 of 6 (494 Views)
Accepted Solution

How to detect that patch is contained in patch bundle, installed on my machine

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...)??

Honored Contributor
Matti_Kurkela
Posts: 6,271
Registered: ‎12-02-2001
Message 2 of 6 (459 Views)

Re: How to detect that patch is contained in patch bundle, installed on my machine

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.

 

Example:

 

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  
#

 

 

MK
Occasional Visitor
simonovsky_pave
Posts: 3
Registered: ‎04-09-2010
Message 3 of 6 (453 Views)

Re: How to detect that patch is contained in patch bundle, installed on my machine

Hi Matti.

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?

Great!

Honored Contributor
Patrick Wallek
Posts: 13,786
Registered: ‎06-21-2000
Message 4 of 6 (449 Views)

Re: How to detect that patch is contained in patch bundle, installed on my machine

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

 

 

Acclaimed Contributor
Dennis Handly
Posts: 25,277
Registered: ‎03-06-2006
Message 5 of 6 (439 Views)

Re: How to detect that patch is contained in patch bundle, installed on my machine

>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

Occasional Visitor
simonovsky_pave
Posts: 3
Registered: ‎04-09-2010
Message 6 of 6 (427 Views)

Re: How to detect that patch is contained in patch bundle, installed on my machine

Hi.

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...

Thanks!

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.