Querying IPS Package Contents

I used the entry that Roman wrote on Querying IPS Packages to search for the OpenSolaris IPS packages that contain gcc:


$ pkg search -r gcc
INDEX      ACTION    VALUE                     PACKAGE
basename   hardlink  usr/sfw/bin/gcc           pkg:/SUNWgcc@3.4.3-0.79
basename   hardlink  usr/sfw/bin/gcc           pkg:/SUNWgcc@3.4.3-0.86
basename   hardlink  usr/sfw/bin/gcc           pkg:/SUNWgcc@3.4.3-0.89
basename   hardlink  usr/sfw/bin/gcc           pkg:/SUNWgcc@3.4.3-0.90
...
The pkg search command found one package: SUNWgcc.

If you look at the man page for pkg, you will notice that in the description of the search subcommand it says: "Search for the token 'token', and display the FMRIs in which the token was found.  Which tokens are indexed are action-dependent, but may include content hashes and pathnames."

Kuldip Oberoi pointed out to me that because not all tokens are searched by pkg search, the results might not always list all packages of interest.  And with the token "gcc" that is in fact the case.  Kuldip suggested:
pkg list -a | grep gcc
But in the end, I modified that a bit to be:
$ pkg list -sa | grep gcc | uniq
SUNWgcc                        gcc - The GNU C compiler
SUNWgccruntime                 GCC Runtime libraries
gcc-dev                        GNU Tools Development cluster
It took longer to run the command, but notice that additional packages were found: SUNWgccruntime and gcc-dev.

The descriptions for SUNWgcc and SUNWgccruntime give me a good sense of what those packages contain, but I was not sure what the term "GNU Tools Development cluster" really encompasses. In my first attempt to find out, I used:
$ pkg contents -r gcc-dev
PATH

Hmmm... not very helpful. That is because by default, the contents subcommand just displays the PATH attribute values from a package; for example:


$ pkg contents SUNWgccruntime
PATH
usr
usr/sfw
usr/sfw/lib
usr/sfw/lib/amd64
usr/sfw/lib/amd64/libfrtbegin.a
usr/sfw/lib/amd64/libg2c.a
usr/sfw/lib/amd64/libg2c.la
usr/sfw/lib/amd64/libg2c.so
...

Unlike the SUNWgccruntime package, the gcc-dev package does not contain any files so that is why there are no PATH entries. To find out what gcc-dev does contain, I add the -m flag so that I can see the complete contents of the package:

$ pkg contents -rm gcc-dev
set name=fmri value=pkg:/gcc-dev@0.5.11,5.11-0.86:20080504T074641Z
set name=authority value=opensolaris.org
set name=description value="GNU Tools Development cluster"
depend fmri=pkg:/SUNWgcc@3.4.3-0.86 type=require
depend fmri=pkg:/SUNWmercurial@0.9.5-0.86 type=require
depend fmri=pkg:/SUNWsvn@1.4.3-0.86 type=require
depend fmri=pkg:/SUNWgnu-automake-19@1.9.6-0.86 type=require
depend fmri=pkg:/SUNWaconf@2.61-0.86 type=require
depend fmri=pkg:/SUNWcvs@1.12.13-0.86 type=require
depend fmri=pkg:/SUNWlibtool@1.5.22-0.86 type=require
depend fmri=pkg:/SUNWgnu-automake-110@1.10-0.86 type=require
depend fmri=pkg:/SUNWgmake@3.81-0.86 type=require
depend fmri=pkg:/SUNWsprot@0.5.11-0.86 type=require
depend fmri=pkg:/SUNWbison@2.3-0.86 type=require
depend fmri=pkg:/SUNWflexlex@2.5.33-0.86 type=require
depend fmri=pkg:/SUNWgdb@6.3-0.86 type=require

So gcc-dev contains no files of its own - just dependencies on other packages.  It provides a convenient way to install all of those dependent packages via a single command:

pfexec pkg install gcc-dev
Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

The Observatory is a blog for users of Oracle Solaris. Tune in here for tips, tricks and more as we explore the Solaris operating system from Oracle.

Connect with Oracle Solaris:


Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today