On Sat, 2008-09-27 at 23:56 +0530, Sivakumar Shanmugasundaram wrote:
> Alan Coopersmith wrote:
> > Sivakumar Shanmugasundaram wrote:
> >   
> >> On a related note, is the presence of OpenSolaris, as against Solaris 
> >> Express, the approved string for differentiating the different flavors 
> >> of Nevada? Thanks
> >>     
> >
> > There should be little you need to test for between the two flavors.
> > The main difference is IPS, which should be as simple as testing for
> > /usr/bin/pkg.   Most other differences come down to which packages
> > are installed, for which you could check for those packages.
> >
> > What other differences do you need to know about?
> >
> >   
> Hypothetical question would be, if some one installed SUNWipkg on a 
> SX*E, wouldn't the test for /usr/bin/pkg fail?
> I just need to get some tests (through shell) to differentiate the two 
> flavors. Thanks

In the desktop build environment install script I needed this
information in order to decide whether to install additional
packages using svr4 or IPS.  The test I use are:
1) check if /usr/bin/pkg and /var/pkg/catalog exist
2) check if SUNWcs was installed using pkg
3) check if SUNWcsu was installed using pkgadd

shell scriptlet follows:

---8<---
# check if the system is pkg(5) based or SVr4 based
# To identify, we check which system was used to install SUNWcs/SUNWcsu
# Output: set the PKG_SYSTEM variable to either pkg or svr4
check_pkg_system () {
    if [ -x /usr/bin/pkg -a -d /var/pkg/catalog ]; then
        /usr/bin/pkg -R $rootdir list SUNWcs > /dev/null 2>&1 && {
            PKG_SYSTEM=pkg
            return
        }
    fi

    /usr/bin/pkginfo -R $rootdir -q SUNWcsu && {
        PKG_SYSTEM=svr4
        return
    }

    msg_err "Could not identify the packaging system"
    exit 1
}
--->8---

Note: this fragment was pasted from a CDDL-licensed script.
Note2: pkg list SUNWcs takes a couple of seconds...

Laca


_______________________________________________
opensolaris-discuss mailing list
[email protected]

Reply via email to