Subject: Re: Use of ${PKGNAME} can lead to confusion
To: Quentin Garnier <cube@cubidou.net>
From: Julio M. Merino Vidal <jmmv84@gmail.com>
List: tech-pkg
Date: 10/09/2005 15:48:20
On 10/9/05, Quentin Garnier <cube@cubidou.net> wrote:
> On Sun, Oct 09, 2005 at 01:58:03PM +0200, Roland Illig wrote:
> > Quentin Garnier wrote:
> > >On Sun, Oct 09, 2005 at 12:46:30PM +0200, Roland Illig wrote:
> > >
> > >>Hi,
> > >>
> > >>many package authors (at least 39) assume that if they write the
> > >>following, the distfiles are downloaded into ${DISTDIR}/package-1.0. =
But
> > >>they are wrong.
> > >>
> > >>PKGNAME=3D          package-1.0
> > >
> > >
> > >You really mean PKGNAME here, not DISTNAME?
> > >
> > >
> > >>PKGREVISION=3D      4
> > >>DIST_SUBDIR=3D      ${PKGNAME}
> >
> > Yes, I mean it. ;) I still find that the PKGNAME is more important than
> > the DISTNAME, and that DISTNAME should be derived from PKGNAME, not the
> > other way round.
>
> Well, you'd better not mixing other changes when giving an example of
> something expected to be found in the tree.  That's really confusing.
>
> > >You should be aware that most (if not all) occurrences of
> > >"DIST_SUBDIR=3D${PKGNAME}" are likely to be there on purpose, because =
at
> > >least once the distfile was changed when its name didn't.
> >
> > Currently there's absolutely no indication (except from "cvs log"
> > sometimes) whether the author intended to use PKGNAME or PKGNAME_NOREV.
> > That's why I proposed the PKGNAME_REV variable.
>
> You mean, no indication besides common sense?  There are very little
> cases where DIST_SUBDIR=3D${PKGNAME_NOREV} would make sense.
>
> While having PKGNAME_REV is probably a good idea, the example for which
> you think it would be useful is bogus.

What I personally find very confusing is the PKGNAME used in PLISTs.
We currently have:

PLIST_SUBST+=3D PKGNAME=3D${PKGNAME_NOREV}

Isn't that asking for trouble? ;-)

--
Julio M. Merino Vidal <jmmv84@gmail.com>
http://www.livejournal.com/users/jmmv/
The NetBSD Project - http://www.NetBSD.org/