HEADS UP: New bsd.*.mk changes

Eivind Eklund eivind at FreeBSD.org
Tue Jan 20 10:41:23 PST 2004


On Tue, Jan 20, 2004 at 01:20:45PM -0500, Joe Marcus Clarke wrote:
> > I totally agree that nobody want to use a variable called 'LATEST_LINK' used for that
> > purpose, but, hey, it's just a name. If we use something like
> > OPTIONSNAME?=${LATEST_LINK}
> > we have to use an workaround only for the port that build no packages, the rest should
> > be automagically right. All the work of thinking of an unique name has already been done
> > for a lot of ports.
> 
> Yes, sorry I've missed some of these points.  I'm trying to balance real
> work and this discussion.  You're right that we could just "borrow"
> LATEST_LINK for the options purpose, but it will require your
> re-ordering patch that will require testing on bento.
> 
> So, the way I see it, we could keep things the way they are and wait for
> the next experimental build cycle, or commit a UNIQUENAME patch that is
> temporary until LATEST_LINK can be evaluated.  Once that gets decided,
> we can PR the patch we want tested.

We take a hit if we put OPTIONS into production without a final settlement
on this, as the options are saved and the users would lose the options they
have set in the meantime.

Here's a UNIQUENAME patch w/docs:

Index: bsd.port.mk
===================================================================
RCS file: /home/pcvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.475
diff -u -r1.475 bsd.port.mk
--- bsd.port.mk	20 Jan 2004 09:14:09 -0000	1.475
+++ bsd.port.mk	20 Jan 2004 18:10:35 -0000
@@ -69,6 +86,8 @@
 #				  Optional.
 # PKGNAMESUFFIX	- Suffix to specify compilation options.  Optional.
 #				  Do not define this in your Makefile.
+# UNIQUENAME    - A name for your port that is globally unique.  By default,
+#				  this is set to ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}
 # DISTNAME		- Name of port or distribution used in generating
 #				  WRKSRC and DISTFILES below (default:
 #				  ${PORTNAME}-${PORTVERSION}).
@@ -1017,7 +1036,8 @@
 # where 'make config' records user configuration options
 PORT_DBDIR?=	/var/db/ports
 
-OPTIONSFILE?=${PORT_DBDIR}/${PORTNAME}/options
+UNIQUENAME?=${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}
+OPTIONSFILE?=${PORT_DBDIR}/${UNIQUENAME}/options
 .if exists(${OPTIONSFILE})
 .include "${OPTIONSFILE}"
 .endif
@@ -4894,8 +4914,8 @@
 .if !defined(OPTIONS)
 	@${ECHO_MSG} "===> No options to configure"
 .else
-	@(${MKDIR} ${PORT_DBDIR}/${PORTNAME} 2> /dev/null) || \
-		(${ECHO_MSG} "===> Cannot create ${PORT_DBDIR}/${PORTNAME}, check permissions"; exit 1)
+	@(${MKDIR} ${PORT_DBDIR}/${UNIQUENAME} 2> /dev/null) || \
+		(${ECHO_MSG} "===> Cannot create ${PORT_DBDIR}/${UNIQUENAME}, check permissions"; exit 1)
 	- at if [ -e ${OPTIONSFILE} ]; then \
 		. ${OPTIONSFILE}; \
 	fi; \
@@ -4964,7 +4984,7 @@
 .if exists(${OPTIONSFILE})
 	-@${ECHO_MSG} "===> Removing user-configured options for ${PORTNAME}"; \
 	${RM} -f ${OPTIONSFILE}; \
-	${RMDIR} ${PORT_DBDIR}/${PORTNAME}
+	${RMDIR} ${PORT_DBDIR}/${UNIQUENAME}
 .else
 	@${ECHO_MSG} "===> No user-specified options configured for ${PORTNAME}"
 .endif


More information about the freebsd-ports mailing list