incremental ports/INDEX builder

Mark Linimon linimon at lonesome.com
Tue Jun 22 07:31:52 PDT 2004


On Tue, 22 Jun 2004, Kris Kennaway wrote:

> That amounts to tracking .included files and
> updating that dependency list when it changes, since those are the
> corner cases that a straightforward implementation doesn't catch.

Is this going to be a part of bsd.port.mk?  If so, I'd like to use
it to solve the FreshPorts/portsmon problem (that of knowing "what
is a slave port").  Both Dan and I are leaning more towards a
bsd.port.mk-based solution (since both of our codebases are already
set up to do that) than eik's outboard solution which a) would have
to be run in parallel, and a) also defines many more ports to be slave
ports than Dan and I consider to be "interesting".   e.g., there is
a certain set of Makevars that he and I are interested in, none of
which are affected by including e.g. the KDE include file.  Yes,
this means that some manual inspection needs to be done -- trading
off guaranteed completeness for speed.

If we do go down the bsd.port.mk-based solution, there are about
40 ports that have to be patched to manually override the proposed
default logic in bsd.port.mk to generate these makevars.  These
ports' Makefiles are too convoluted for me to dare to try to rework
them as true masterports.

Here is what I am using at the moment.  I would really like to know
whether we think that this is something that belongs in bsd.port.mk
or not, and if so, if the variable names are OK.  If it is, I'll go
ahead and submit patches for the 40 ports.  If not, the 40 ports will
continue to be wrong on both portsmon and FreshPorts until some
(possibly significant?) reengineering is done.

(Note: unlike earlier versions of this patch, no extra processes
are involved, and the output is strictly 'categoryname/portname'.)

mcl

Index: bsd.port.mk
===================================================================
RCS file: /home/FreeBSD/pcvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.491
diff -u -r1.491 bsd.port.mk
--- bsd.port.mk	10 Jun 2004 07:30:19 -0000	1.491
+++ bsd.port.mk	22 Jun 2004 13:48:33 -0000
@@ -913,6 +913,16 @@
 
 MASTERDIR?=	${.CURDIR}
 
+# Try to determine if we are a slave port.  These variables are used by
+# FreshPorts and portsmon, but not yet by the ports framework itself.
+.if ${MASTERDIR} != ${.CURDIR}
+IS_SLAVE_PORT?=	yes
+MASTERPORT?=	${MASTERDIR:C/[^\/]+\/\.\.\///:C/[^\/]+\/\.\.\///:C/^.*\/([^\/]+\/[^\/]+)$/\\1/}
+.else
+IS_SLAVE_PORT?=	no
+MASTERPORT?=
+.endif
+
 # If they exist, include Makefile.inc, then architecture/operating
 # system specific Makefiles, then local Makefile.local.



More information about the freebsd-ports mailing list