Operating System - HP-UX
1758607 Members
2588 Online
108873 Solutions
New Discussion юеВ

Identify with swlist with which product a specific file was installed

 
Rui Vilao
Regular Advisor

Identify with swlist with which product a specific file was installed

Greetings,

Problem: I have a file (eg lint)

I want to know to which installed product it belongs.

With "swlist -l file" I get a listing of all Filesets and respective files.


Thanks in advance for your help,

Kind Regards,

Rui.
"We should never stop learning"_________ rui.vilao@rocketmail.com
6 REPLIES 6
Cheryl Griffin
Honored Contributor

Re: Identify with swlist with which product a specific file was installed

Try:
# swlist -l file |grep lint

For example:
# swlist -l file |grep envd
OS-Core.UX-CORE:/ etc/envd.conf
OS-Core.UX-CORE: /etc/rc.config.d/envd
OS-Core.UX-CORE: /sbin/init.d/envd
PHCO_20060.PHCO_20060: /usr/sbin/envd

this means that the OS-CORE fileset contains the command, but patch PHCO_20060 has updated the fileset.
"Downtime is a Crime."
James R. Ferguson
Acclaimed Contributor

Re: Identify with swlist with which product a specific file was installed

Hi:

To add to Cheryl's response, if you want additional details, (e.g. installation date) add the -v flag to the swlist.

...JRF...
Rui Vilao
Regular Advisor

Re: Identify with swlist with which product a specific file was installed

Cheryl and James,

Thanks a lot for your contribution.

With swlist -l file, I can find out the
relationship: fileset-file
But the question remains. How can I know to which installed product (output
of swlist) envd or lint.
"We should never stop learning"_________ rui.vilao@rocketmail.com
marc seguin
Regular Advisor

Re: Identify with swlist with which product a specific file was installed

#swlist -l file|grep 'lint'
C-Analysis-Tools.C-TOOLS: /opt/ansic/bin/lint
OS-Core.C-MIN: /usr/ccs/lib/lint
ProgSupport.PROG-AUX: /usr/ccs/lib/lint
ProgSupport.PROG-MIN: /usr/ccs/lib/lint

which means : PRODUCT.FILESET: FILE
So you have everything you need !
Greg Vaidman
Respected Contributor

Re: Identify with swlist with which product a specific file was installed

swlist will give you the answer, but this might be a little faster...

find /var/adm/sw/products -name INDEX -exec grep "/lint$" {} \; -print

note the leading "/" and trailing "$" (end of line) make the grep more reliable.

you should be able to tell the product name from the path returned from the print command.

the reason this works is that this is what swlist is really doing anyway, and you don't have the overhead of creating the swlist process and pushing the huge output of all the files on the system through a pipe.

you do, however, have to be root to do this, as the directory is not readable unless you are. 8-)

regards,
greg
Rui Vilao
Regular Advisor

Re: Identify with swlist with which product a specific file was installed

Marc and Greg,

Thanks a lot for your contribution!
However your answers are not totally correct.

I know that lint was installed with the products B3901BA, B3913CB and B3913DB:

B3901BA B.11.01.20 HP C/ANSI C Developer's B
undle for HP-UX 11.00 (S800)
B3913CB B.11.01.20 HP C++ Compiler (S800)
B3913DB C.03.25 HP aC++ Compiler (S800)


I want to know if I have other products that installed this executable.

"swlist -l file" returns the filesets and associated files...

I investigated and found out that the information I need can be retrieved using:

# swlist -l file -l bundle |grep "/lint"
B3901BA.C-Analysis-Tools.C-TOOLS: /opt/ansic/bin/lint
B3901BA.C-Analysis-Tools.C-TOOLS: /opt/ansic/lbin/lint2
B3901BA.C-Analysis-Tools.C-TOOLS: /opt/ansic/lib/nls/msg/C/lint.cat

B3901BA.C-Analysis-Tools.C-TOOLS-MAN: /opt/ansic/share/man/ja_JP.SJIS/man1.Z/l
int.1
B3901BA.C-Analysis-Tools.C-TOOLS-MAN: /opt/ansic/share/man/ja_JP.eucJP/man1.Z/
lint.1
B3901BA.C-Analysis-Tools.C-TOOLS-MAN: /opt/ansic/share/man/man1.Z/lint.1

HPUXEng32RT.OS-Core.C-MIN: /usr/ccs/lib/lint
HPUXEng32RT.OS-Core.C-MIN: /usr/ccs/lib/lint/llib-lc
HPUXEng32RT.OS-Core.C-MIN: /usr/ccs/lib/lint/llib-lm
HPUXEng32RT.ProgSupport.PROG-AUX: /usr/ccs/lib/lint
HPUXEng32RT.ProgSupport.PROG-AUX: /usr/ccs/lib/lint/llib-ldbm
HPUXEng32RT.ProgSupport.PROG-AUX: /usr/ccs/lib/lint/llib-port
HPUXEng32RT.ProgSupport.PROG-MIN: /usr/ccs/lib/lint
HPUXEng32RT.ProgSupport.PROG-MIN: /usr/ccs/lib/lint/llib-lHcurses

HPUXEng32RT.ProgSupport.PROG-MIN: /usr/ccs/lib/lint/llib-lcurses

UXCoreMedia.OS-Core.C-MIN: /usr/ccs/lib/lint
UXCoreMedia.OS-Core.C-MIN: /usr/ccs/lib/lint/llib-lc
UXCoreMedia.OS-Core.C-MIN: /usr/ccs/lib/lint/llib-lm
UXCoreMedia.ProgSupport.PROG-AUX: /usr/ccs/lib/lint
UXCoreMedia.ProgSupport.PROG-AUX: /usr/ccs/lib/lint/llib-ldbm
UXCoreMedia.ProgSupport.PROG-AUX: /usr/ccs/lib/lint/llib-port
UXCoreMedia.ProgSupport.PROG-MIN: /usr/ccs/lib/lint
UXCoreMedia.ProgSupport.PROG-MIN: /usr/ccs/lib/lint/llib-lHcurses

UXCoreMedia.ProgSupport.PROG-MIN: /usr/ccs/lib/lint/llib-lcurses


Thanks again for your help!

Regards,

Rui.
"We should never stop learning"_________ rui.vilao@rocketmail.com