Subject: Re: Package naming and major versions [was Re: CVS commit:
To: Johnny C. Lam <jlam@NetBSD.org>
From: Gavan Fantom <gavan@coolfactor.org>
List: tech-pkg
Date: 10/05/2004 10:46:16
On Mon, 4 Oct 2004, Johnny C. Lam wrote:
> And then at the top level pkgsrc directory, add a Makefile.inc that
> looks like:
>
> # Calculate depth
> .if !defined(_PKGSRC_TOPDIR)
> . if exists(${.CURDIR}/../../../../mk/bsd.pkg.mk)
> _PKGSRC_TOPDIR= ${.CURDIR}/../../../..
> . elif exists(${.CURDIR}/../../../mk/bsd.pkg.mk)
> _PKGSRC_TOPDIR= ${.CURDIR}/../../..
> . elif exists(${.CURDIR}/../../mk/bsd.pkg.mk)
> _PKGSRC_TOPDIR= ${.CURDIR}/../..
> . elif exists(${.CURDIR}/../mk/bsd.pkg.mk)
> _PKGSRC_TOPDIR= ${.CURDIR}/..
> . elif exists(${.CURDIR}/mk/bsd.pkg.mk)
> _PKGSRC_TOPDIR= ${.CURDIR}
> . endif
> .endif
>
> .if !defined(PKGSRCDIR)
> PKGSRCDIR!= cd ${_PKGSRC_TOPDIR} && pwd
> .endif
If you're going to do this, wouldn't it be better to reverse the order of
these tests?
I could have a pkgsrc tree ~/pkgsrc, and another directory ~/mk containing
a file called bsd.pkg.mk, which would incorrectly cause _PKGSRC_TOPDIR to
be set to ~ instead of ~/pkgsrc.
--
Gillette - the best a man can forget