Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Jun 2004 15:29:00 +0200
From:      Oliver Eikemeier <eikemeier@fillmore-labs.com>
To:        Mark Linimon <linimon@lonesome.com>
Cc:        Kris Kennaway <kris@obsecurity.org>
Subject:   Re: incremental ports/INDEX builder
Message-ID:  <40D8341C.5080502@fillmore-labs.com>

next in thread | raw e-mail | index | archive | help
Mark Linimon wrote:

> 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.

I'm sorry that I have been unable to show you the script delivers
exactly what you want. To find slave ports of a port you could do:

  awk -F\| -v MASTER="mail/qmail" '$1 == MASTER "/Makefile" {print MASTER " -> " $3}' $DEPENDSFILE

with a result of:

  mail/qmail -> mail/qmail mail/qmail-ldap mail/qmail-mysql mail/qmail-smtp_auth+tls mail/qmail-tls


To find master ports, just do:

  grep '^[^/]*/[^/]*/Makefile|' $DEPENDSFILE |
  awk -F\| -v SLAVE="mail/qmail-mysql" '$3 ~ "(^| )" SLAVE "( |$)" {sub("/Makefile$", "", $1); print $1}'

Result:

  mail/qmail-mysql
  mail/qmail

(in this example you have to quote metacharaters in SLAVE, like 
 SLAVE="mail/qmail-smtp_auth\\+tls", but that is an problem of
 awk, not the database.)

Besides, you have to feed the list of updated files to some script
to update the debedency database, which won't work with a pure
`make -V' solution.

The database has more information, like that 149 ports depend on
x11/kde3/Makefile.kde, but if you don't want to know then simply
don't ask.

> 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.

Tell me some names, and I will tell you what my script delivers. You 
still owe me a sample where my script is wrong.

> 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.

I guess this patch is fine.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?40D8341C.5080502>