pkgsrc-Users archive

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

Re: PKGPATH conditions in mk.conf (was: Re: Recipe to address cyclic deps for bulkbuild?)



On Thu, Aug 11, 2022 at 07:47:54PM +0100, Jonathan Perkin wrote:
> * On 2022-08-11 at 19:19 BST, Roland Illig wrote:
> 
> > Am 11.08.2022 um 12:30 schrieb nia:
> > > On Thu, Aug 11, 2022 at 12:15:28PM +0530, Mayuresh wrote:
> > > > Just like we can set PKG_OPTIONS.pkgbase, can package specific values be
> > > > provided for other variables - say PKGSRC_COMPILER.
> > > 
> > > .if !empty(PKGPATH:Mlang/perl5)
> > 
> > Just out of interest: since PKGPATH is guaranteed to be defined in
> > mk.conf and since it contains a single word only, the above condition
> > can also be written as:
> > 
> > .if ${PKGPATH} == lang/perl5
> > 
> > .if ${PKGPATH} == "lang/perl5"
> > 
> > .if ${PKGPATH:Mlang/perl5}
> > 
> > I wonder whether there is any benefit of the '!empty' over the above
> > alternatives, other than "we've always done it like that".
> 
> Something is niggling in the back of my mind that there is some situation
> where PKGPATH isn't defined and I saw errors, but I can't recall what it
> was.
> 
> Maybe at some point I'll test the bare variable, but will have to wait for a
> rainy day.

In that case it would still be simpler to write it as ${PKGPATH:U}.

Joerg


Home | Main Index | Thread Index | Old Index