Subject: Re: Package naming and major versions [was Re: CVS commit: pkgsrc/devel/gal20]
To: Gavan Fantom <gavan@coolfactor.org>
From: Johnny C. Lam <jlam@NetBSD.org>
List: tech-pkg
Date: 10/05/2004 13:16:25
On Tue, Oct 05, 2004 at 10:46:16AM +0100, Gavan Fantom wrote:
> 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.

Yes, it makes more sense to climb up the tree than guess at the top and
climb down.

	Cheers,

	-- Johnny Lam <jlam@NetBSD.org>