Bug in ports system's DISTFILES handling?
Edwin Groothuis
edwin at mavetju.org
Tue Jan 18 23:26:12 PST 2005
On Wed, Jan 19, 2005 at 12:54:27AM -0600, Conrad J. Sabatier wrote:
> This just seems less than intuitive, if you ask me, especially given
> that the += operator does work with other variables without requiring
> the explicit definition of an initial value first.
Euhm... you need to keep a couple of things seperated:
- The ports framework (bsd.port.mk) consists of two parts:
- One to set the basic variables which are not directly port
related, for example OSVERSION, WANT_GNOME and LOCALBASE.
This is called "bsd.port.pre.mk".
- One to set the basic variables which are directly port
related, for example LIB_DEPENDS and the pre/do/post targets.
This is called "bsd.port.post.mk".
The definition of DISTFILES itself is defined in the second part.
Why? I don't know. It shouldn't have, because all the necessary
information to build DISTFILES (DISTNAME and EXTRACT_SUFX) are
defined in the "bsd.port.pre.mk" part.
> I mean, if this were something that was consciously decided on, that's
> one thing, but the lack of consistency would seem to indicate that it's
> just not as well implemented as it could/should be.
I wouldn't go that far. I don't think you're the first who steps
into this problem and goes "euhm... this doesn't make sense", but
I think you're the first who goes "euhm... guys! this doesn't make
sense!"
For example see biology/garlic:
DISTFILES= ${DISTNAME}${EXTRACT_SUFX}
.if !defined(NOPORTDOCS)
DISTFILES+= ${DISTNAME}-doc${EXTRACT_SUFX}
.endif
I won't say that
-DISTFILES= ${DISTNAME}${EXTRACT_SUFX}
.if !defined(NOPORTDOCS)
DISTFILES+= ${DISTNAME}-doc${EXTRACT_SUFX}
.endif
should work, but I would say that:
-DISTFILES= ${DISTNAME}${EXTRACT_SUFX}
+.include <bsd.port.pre.mk>
.if !defined(NOPORTDOCS)
DISTFILES+= ${DISTNAME}-doc${EXTRACT_SUFX}
.endif
should work.
Or even:
DISTFILES= ${DISTNAME}${EXTRACT_SUFX}
.if !defined(NOPORTDOCS)
+EXTRA_DISTFILES+=${DISTNAME}-doc${EXTRACT_SUFX}
.endif
which would work as EXTRA_PATCHES.
Or to make it easiest of all:
-DISTFILES= ${DISTNAME}${EXTRACT_SUFX}
+DISTFILES= ${DEFAULTDISTFILE}
.if !defined(NOPORTDOCS)
DISTFILES+= ${DISTNAME}-doc${EXTRACT_SUFX}
.endif
and then DEFAULTDISTFILE is in the "bsd.port.pre.mk" defined. This
way it's easy to for the Makefile of chinese/xcin25:
DISTFILES= ${DEFAULTDISTFILE} chewing-2002Jan07-snapshot.tar.gz
No confusion about things here.
I would go for the last one, and volunteer to send patches when
there is some consensus.
Edwin
--
Edwin Groothuis | Personal website: http://www.mavetju.org
edwin at mavetju.org | Weblog: http://weblog.barnet.com.au/edwin/
More information about the freebsd-ports
mailing list