From owner-freebsd-ports@FreeBSD.ORG Sun Aug 5 05:53:41 2007 Return-Path: Delivered-To: ports@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3771416A417; Sun, 5 Aug 2007 05:53:41 +0000 (UTC) (envelope-from kris@obsecurity.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 329F813C46B; Sun, 5 Aug 2007 05:53:41 +0000 (UTC) (envelope-from kris@obsecurity.org) Received: from rot26.obsecurity.org (elvis.mu.org [192.203.228.196]) by elvis.mu.org (Postfix) with ESMTP id 95F131A4D7E; Sat, 4 Aug 2007 22:52:58 -0700 (PDT) Received: by rot26.obsecurity.org (Postfix, from userid 1001) id 3B6DABFBE; Sun, 5 Aug 2007 01:53:40 -0400 (EDT) Date: Sun, 5 Aug 2007 01:53:40 -0400 From: Kris Kennaway To: ports@FreeBSD.org Message-ID: <20070805055340.GA11899@rot26.obsecurity.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jRHKVT23PllUwdXP" Content-Disposition: inline User-Agent: Mutt/1.4.2.3i Cc: Subject: PORTSDIR use-before-define fix X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Aug 2007 05:53:41 -0000 --jRHKVT23PllUwdXP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Previous DESTDIR commits introduced dereferences of ${PORTSDIR} before it was set (via .include), which broke e.g. portmaster. This diff shuffles some things around to hopefully restore everything to being defined before it is used. It also cleans up some stale cruft. It has only been lightly tested. Kris Index: bsd.port.mk =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/pcvs/ports/Mk/bsd.port.mk,v retrieving revision 1.579 diff -u -r1.579 bsd.port.mk --- bsd.port.mk 4 Aug 2007 19:48:34 -0000 1.579 +++ bsd.port.mk 5 Aug 2007 05:50:10 -0000 @@ -1089,6 +1089,17 @@ # Most port authors should not need to understand anything after this poin= t. # =20 +# These need to be absolute since we don't know how deep in the ports +# tree we are and thus can't go relative. They can, of course, be overrid= den +# by individual Makefiles or local system make configuration. +PORTSDIR?=3D /usr/ports +LOCALBASE?=3D /usr/local +X11BASE?=3D ${LOCALBASE} +LINUXBASE?=3D /compat/linux +DISTDIR?=3D ${PORTSDIR}/distfiles +_DISTDIR?=3D ${DISTDIR}/${DIST_SUBDIR} +INDEXDIR?=3D ${PORTSDIR} + .include "${PORTSDIR}/Mk/bsd.commands.mk" =20 # @@ -1294,16 +1305,6 @@ PKGNAME=3D ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}-${PKGVERSION} DISTNAME?=3D ${PORTNAME}-${DISTVERSIONPREFIX}${DISTVERSION:C/:(.)/\1/g}${D= ISTVERSIONSUFFIX} =20 -# These need to be absolute since we don't know how deep in the ports -# tree we are and thus can't go relative. They can, of course, be overrid= den -# by individual Makefiles or local system make configuration. -PORTSDIR?=3D /usr/ports -LOCALBASE?=3D /usr/local -X11BASE?=3D ${LOCALBASE} -LINUXBASE?=3D /compat/linux -DISTDIR?=3D ${PORTSDIR}/distfiles -_DISTDIR?=3D ${DISTDIR}/${DIST_SUBDIR} -INDEXDIR?=3D ${PORTSDIR} INDEXFILE?=3D INDEX-${OSVERSION:C/([0-9]).*/\1/} =20 DOCSDIR?=3D ${PREFIX}/share/doc/${PORTNAME} @@ -2300,7 +2301,6 @@ .undef NO_PACKAGE .endif =20 -COMMENTFILE?=3D ${PKGDIR}/pkg-comment DESCR?=3D ${PKGDIR}/pkg-descr PLIST?=3D ${PKGDIR}/pkg-plist PKGINSTALL?=3D ${PKGDIR}/pkg-install Index: bsd.port.subdir.mk =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/pcvs/ports/Mk/bsd.port.subdir.mk,v retrieving revision 1.71 diff -u -r1.71 bsd.port.subdir.mk --- bsd.port.subdir.mk 4 Aug 2007 11:37:24 -0000 1.71 +++ bsd.port.subdir.mk 5 Aug 2007 05:50:10 -0000 @@ -40,6 +40,21 @@ # Search for ports using either 'make search key=3D' # or 'make search name=3D'. =20 +PORTSDIR?=3D /usr/ports +TEMPLATES?=3D ${PORTSDIR}/Templates +.if defined(PORTSTOP) +README=3D ${TEMPLATES}/README.top +.else +README=3D ${TEMPLATES}/README.category +.endif +MOVEDDIR?=3D ${PORTSDIR} +MOVEDFILE?=3D MOVED + +# XXX Are these needed here? DESCR was set wrong for a few years +MASTERDIR?=3D ${.CURDIR} +PKGDIR?=3D ${MASTERDIR} +DESCR?=3D ${PKGDIR}/pkg-descr + .include "${PORTSDIR}/Mk/bsd.commands.mk" =20 .MAIN: all @@ -66,6 +81,9 @@ .endif .endif =20 +INDEXDIR?=3D ${PORTSDIR} +INDEXFILE?=3D INDEX-${OSVERSION:C/([0-9]).*/\1/} + UID!=3D ${ID} -u .if exists(${LOCALBASE}/sbin/pkg_info) PKG_INFO?=3D ${LOCALBASE}/sbin/pkg_info @@ -249,28 +267,6 @@ @${MAKE} README.html .endif =20 -.if (${OPSYS} =3D=3D "NetBSD") -PORTSDIR ?=3D /usr/opt -.else -PORTSDIR ?=3D /usr/ports -.endif -TEMPLATES ?=3D ${PORTSDIR}/Templates -.if defined(PORTSTOP) -README=3D ${TEMPLATES}/README.top -.else -README=3D ${TEMPLATES}/README.category -.endif -COMMENTFILE?=3D ${.CURDIR}/pkg/COMMENT -DESCR?=3D ${.CURDIR}/pkg/DESCR -INDEXDIR?=3D ${PORTSDIR} -.if ${OSVERSION} >=3D 500036 -INDEXFILE?=3D INDEX-${OSVERSION:C/([0-9]).*/\1/} -.else -INDEXFILE?=3D INDEX -.endif -MOVEDDIR?=3D ${PORTSDIR} -MOVEDFILE?=3D MOVED - HTMLIFY=3D ${SED} -e 's/&/\&/g' -e 's/>/\>/g' -e 's/ $@.tmp4 .else -.if exists(${COMMENTFILE}) - @${HTMLIFY} ${COMMENTFILE} > $@.tmp4 -.else @> $@.tmp4 .endif .endif @@ -415,7 +408,7 @@ break; \ }\ } \ - if (toprint =3D=3D 1 ) disp[fields[d[i]]] =3D 1; \ + if (toprint =3D=3D 1 ) disp[fields[d[i]]] =3D 1; \ } \ } \ { \ --jRHKVT23PllUwdXP Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFGtWXjWry0BWjoQKURAtgiAJ4lulypxlCN3YRK36OqMu6SWm819ACeJ5pa pxif9vMqVJam9IRp04qjc/I= =8W37 -----END PGP SIGNATURE----- --jRHKVT23PllUwdXP--