ports need a uniq identifier, do you have any suggestion?
Baptiste Daroussin
bapt at freebsd.org
Mon Jun 11 13:50:47 UTC 2012
On Mon, Jun 11, 2012 at 02:17:21PM +0100, Matthew Seaman wrote:
> On 11/06/2012 12:55, Baptiste Daroussin wrote:
> > why because they recommand their user to set PKGNAMEPREFIX to
> > ${BLA_PKGNAMEPREFIX} so that their prefix can be set from bsd.port.mk
> > Which mean that until the said bsd.$guilty.mk is included UNIQUENAME name is set
> > to ${PKGNAMEPREFIX}${PORTNAME} with PKGNAMEPREFIX being expanded to nothing
> > and once bsd.$guilty.mk is included ${PKGNAMEPREFIX} expands to something and so
> > UNIQUENAME is changed. (btw also break the options framework (old and new) with
> > the ports because OPTIONSFILE is created using the ${UNIQUENAME}
>
> A light dawns. Yes. The value of $OPTIONSFILE cannot depend on
> anything that happens in the port after bsd.port.options.mk is .include'd.
>
> How about this (untested):
I tried what you did :) but it doesn't work
because
On first pass (before bsd.port.options.mk:
PORTNAME is test
UNIQUENAME is ${PKGNAMEPREFIX}${PORTNAME}
and PKGNAMEPREFIX is for example ${PYTHON_PKGNAMEPREFIX}
and ${PYTHON_PKGNAMEPREFIX} is empty.
which means after
BLA:= ${UNIQUENAME}
Only the first level is expanded and so:
BLA is now ${PYTHON_PKGNAMEPREFIX}test
if use in first pass then it becomes test
when used after bsd.port.pre.mk
PYTHON_PKGNAMEPREFIX become py27-
and so BLA is py27-
The joy of make(1)
>
> % cvs diff
> cvs diff: Diffing .
> Index: bsd.options.mk
> ===================================================================
> RCS file: /home/ncvs/ports/Mk/bsd.options.mk,v
> retrieving revision 1.13
> diff -u -r1.13 bsd.options.mk
> --- bsd.options.mk 6 Jun 2012 11:47:29 -0000 1.13
> +++ bsd.options.mk 11 Jun 2012 13:03:47 -0000
> @@ -8,8 +8,6 @@
> # global ones and ending with the ones decided by the maintainer.
> # Options global to the entire ports tree
>
> -OPTIONSFILE?= ${PORT_DBDIR}/${UNIQUENAME}/options
> -
> #ALL_OPTIONS= DOCS \
> # NLS
>
> Index: bsd.port.mk
> ===================================================================
> RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v
> retrieving revision 1.727
> diff -u -r1.727 bsd.port.mk
> --- bsd.port.mk 8 Jun 2012 19:52:39 -0000 1.727
> +++ bsd.port.mk 11 Jun 2012 13:06:35 -0000
> @@ -1268,6 +1268,10 @@
> UNIQUENAME?= ${PKGNAMEPREFIX}${PORTNAME}
> .endif
>
> +.if !defined(OPTIONSFILE)
> +OPTIONSFILE:= ${PORT_DBDIR}/${UNIQUENAME}/options
> +.endif
> +
> .endif
>
> DOS2UNIX_REGEX?= .*
>
> So OPTIONSFILE is at least independent of any changes to PKGNAMEPREFIX
> made by bsd.$guilty.mk?
>
> Port maintainers wishing to override the default OPTIONSFILE setting
> should obviously do that before the inclusion of bsd.port.options.mk
>
> Cheers,
>
> Matthew
>
> --
> Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard
> Flat 3
> PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
> JID: matthew at infracaninophile.co.uk Kent, CT11 9PW
>
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20120611/f0c94daa/attachment.pgp
More information about the freebsd-ports
mailing list