tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: make -V



On Sat, Aug 11, 2012 at 07:48:23PM +0200, Alistair Crooks stupidly wrote:
> On Sat, Aug 11, 2012 at 10:16:21AM -0700, Simon J. Gerraty wrote:
> > 
> > On Sat, 11 Aug 2012 08:58:43 +0200, Alistair Crooks writes:
> > >In pkgsrc, we have the obvious "expand the VAR" behavior in bsd.pkg.mk:
> > >
> > >show-var:
> > >        @${ECHO} ${${VARNAME}:Q}
> > >
> > >[23:14:38] agc@netbsd-vm2 ...pkgsrc/editors/ssam [10004] > make show-var 
> > >VARNA
> > >ME=PKGNAME
> > >ssam-1.9nb1
> > 
> > Yes, but this is the sort of indirection etc that started me thinking
> > on this topic.
> > Simply doing
> > 
> > make -V PKGNAME
> > 
> > would have been much simpler and more obvious if it could have
> > been relied on to produce an expanded result.
> 
> Not quite the same:
> 
> [10:04:20] agc@netbsd-vm2 ...pkgsrc/editors/ssam [10210] > make -V PKGNAME
> ${DISTNAME}nb${PKGREVISION}
> [10:04:28] agc@netbsd-vm2 ...pkgsrc/editors/ssam [10211] >

Sorry, should have had some coffee before sending that last one.  My
point was that, rather than change existing behavior in perhaps
unpredictable ways, it is better to use a "user-level" expansion for
doing the full expansion, and use the "nuts n bolts" -V machinery to
get to the "how we got here" type of expansion.

Then there's no intrusion into existing behavior, and gets more
functionality (and, potentially, a way to quote or not quote
expansion, depending on desired behavior).

Regards,
Alistair


Home | Main Index | Thread Index | Old Index