Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Nov 1998 16:15:08 -0500 (EST)
From:      Bill Fumerola <billf@chc-chimes.com>
To:        freebsd-ports@FreeBSD.ORG
Subject:   bsd.port.mk updates and such
Message-ID:  <Pine.HPP.3.96.981104150505.19007G-100000@hp9000.chc-chimes.com>

next in thread | raw e-mail | index | archive | help

problem:

As anyone who follows this list and the ports PR's knows, people not
having an updated bsd.port.mk is the cause of a LOT of problems for
people. The inability to update this file is caused by several reasons:

(i) Some people only cvs(or cvsup) /cvs/ports (or ports-*)

	These people never recieve the new bsd.port.mk until they upgrade
their machine, or start cvs'ing src/share/mk or src-share.

(ii) Some people, even though they keep up-to-date with -STABLE or
-CURRENT don't installworld on a regular basis.

	I track -STABLE on a p75 overdrive, needless to say, I don't build
world everytime there is a change in -STABLE. Though I _could_ (cd
/usr/src/share/mk/ && make install) or add a cron to do that, I don't, and
we can't expect everyone else to either.

requirements for solutions:

(i) Any solution proposed must allow for updates to be made through the
SAME archive which is being effected. ie, it would be silly for me to have
track a single branch of -CURRENT to have my -STABLE work, so why should
people have to track /src, just to track /ports.

(ii) Any solution must not have a hardcoded /usr/ports or any path, for
that matter, to work.

(iii) Any change must allow for the fact that in the future the ports
collection may move to a category and subcategory structure.

(iv) the make variables must not interfere with non-ports makes, ie, make
can't include the file everytime.

(v) the make variables shouldn't be loaded twice

(vi) bsd.port.mk can't be included from make.conf because it is called
before make(1) realizes that the file is even a port, amongst other
reasons.

(though adding a PORTS_GLOBAL_MAKEFILE=/usr/share/mk/bsd.port.mk to my
/etc/make.conf, and then ".include (${PORTS_GLOBAL_MAKEFILE})" to my
port's Makefile _did_ work, I was told this was bad style.)

proposed solution:

In theory every category (or subcategory, for that matter) should know how
far it is away from the root dir. therefore by placing a ports.include (or
some other properly named file) in the CATEGORY directory with an .include
for ../../bsd.port.mk (or however far away the _port_ is from the base
directory) we could keep bsd.port.mk in ports-base. this is how such a
thing would look..

billf@jade$ cd /usr/ports
billf@jade$ ls -l bsd.port.mk 
-r--r--r--  1 root  wheel  69524 Nov  2 16:53 bsd.port.mk
billf@jade$ cd net
billf@jade$ ls -l ports.include 
-rw-r--r--  1 root  wheel  29 Nov  2 16:54 ports.include
billf@jade$ cat ports.include 
.include <../../bsd.port.mk>
billf@jade$ cd ethereal-bill

<--- even though we keep the file in the CATEGORY directory, we need to
keep the path relative to the ${.CURDIR} (the port itself) --->

billf@jade$ ls -l ../../bsd.port.mk 
-r--r--r--  1 root  wheel  69524 Nov  2 16:53 ../../bsd.port.mk

billf@jade$ head -5 Makefile; tail -5 Makefile 
# New ports collection makefile for:   ethereal
# Version required:    0.4.1
# Date created:        10 August 1998
# Whom:                Bill Fumerola <billf@chc-chimes.com>
#
<-SNIP->
.if exists(../ports.include)
.include <../ports.include>
.else
.include <bsd.port.mk>
.endif

The else statement allows for those people who ftp a directory from
freebsd.org and then extract it into their home directory. If they are
manually doing this I think it is reasonable to assume they can also ftp
bsd.port.mk from the ftp site as well.

A kernel trace reveals that it is indeed grabbing the correct file..

  4627 make     GIO   fd 5 read 29 bytes
       ".include <../../bsd.port.mk>
       "
  4627 make     RET   read 29/0x1d
  4627 make     CALL  stat(0x23d00,0xefbfca48)
  4627 make     NAMI  "../../bsd.port.mk"

and never loads the bsd.port.mk from /usr/share/mk (which is important)

Please comment on the above method.

ps. Thanks to jkh and EE for their input on the above, this is not a
statement of their endorsement, but they merely pointed me in the (right?)
direction.

- bill fumerola [root/billf]@chc-chimes.com - computer horizons corp -
-  ph:(800)252.2421 x128 / bfumerol@computerhorizons.com - BF1560  -

	"Logic, like whiskey, loses its beneficial effect 
	when taken in too large quantities" -Lord Dunsany







To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.HPP.3.96.981104150505.19007G-100000>