[prev in list] [next in list] [prev in thread] [next in thread] 

List:       opensolaris-smf-discuss
Subject:    Re: [smf-discuss] [networking-discuss] [pkg-discuss] Code review
From:       Nicolas Williams <Nicolas.Williams () sun ! com>
Date:       2009-06-16 16:24:02
Message-ID: 20090616162402.GR1308 () Sun ! COM
[Download RAW message or body]

On Tue, Jun 16, 2009 at 11:06:11AM -0400, Paul Wernau wrote:
> 
> 
> Nicolas Williams wrote:
> > On Tue, Jun 16, 2009 at 01:14:01AM +0200, Darren Reed wrote:
> >> So, in $SRC/pkgdefs/SUNWcsr/postinstall, I can see this:
> >>
> >> ...
> >> cat >> $BASEDIR/var/svc/profile/upgrade <<\_DEL_BIND8
> > 
> > That's a bug.
> > 
> >> ...
> >>        cat >> ${PKG_INSTALL_ROOT}/var/svc/profile/upgrade <<\_IPSECUPGRD
> >> ...
> > 
> > That too is a bug, though arguably SUNWcsr can't actually be relocated,
> > therefore it shouldn't be relocatable, and BASEDIR shouldn't be used.  I
> > don't know why core pkgs that couldn't possibly be relocated are
> > nonetheless relocatable -- I've long thought it most strange.
> > 
> 
> On the latter, I don't follow, especially if you read the link you provided:
> 
> > http://docs.sun.com/app/docs/doc/820-4042/package-2?a=view
> 
> The way I understand it is that all packages can have an alternative
> root ($PKG_INSTALL_ROOT), but that relocatable *objects* inside packages
> are referenced with $BASEDIR.  That doesn't mean that all objects within
> a package are relocatable.  Am I missing something?

A package is relocatable if it contains relocatable files/directories.
Those are ones whose path in the prototype/pkgmap files don't start with
'/'.  There are two varieties of relocatable paths: those that start
with $<variable> and those that start with not '$' and not '/'.  The
former are relative to a variable defined in pkginfo, the latter are
relative to BASEDIR.  There's always a BASEDIR, but you can have all
non-relocatable paths, in which case BASEDIR is useless.

In SVR4 packaging scripts that edit files or reference files from the
installed image (CAS, postinstall, ...) you MUST use BOTH,
PKG_INSTALL_ROOT _and_ the variable(s) used for relocatable paths when
referring to relocatable files, or just PKG_INSTALL_ROOT when referring
to non-relocatable files.

Nico
-- 
_______________________________________________
smf-discuss mailing list
smf-discuss@opensolaris.org
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic