ports need a uniq identifier, do you have any suggestion?

Matthew Seaman m.seaman at infracaninophile.co.uk
Mon Jun 11 13:17:38 UTC 2012


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):

% 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: signature.asc
Type: application/pgp-signature
Size: 267 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20120611/446e07b7/signature.pgp


More information about the freebsd-ports mailing list