Subject: Use of ${PKGNAME} can lead to confusion
To: NetBSD Packages Technical Discussion List <tech-pkg@NetBSD.org>
From: Roland Illig <rillig@NetBSD.org>
List: tech-pkg
Date: 10/09/2005 12:46:30
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= package-1.0
PKGREVISION= 4
DIST_SUBDIR= ${PKGNAME}
What really happens is that bsd.pkg.mk modifies PKGNAME and appends the
PKGREVISION to it. That is, whenever the PKGREVISION is bumped, the
distfiles are downloaded again. Certainly there are other places where
the modification of PKGNAME leads to confusion.
Therefore I suggest that a new variable PKGNAME_REV be introduced and
the use of ${PKGNAME} be deprecated. Then we have PKGNAME, PKGNAME_NOREV
and PKGNAME_REV.
The use of ${PKGNAME} then means the developer does not know that
PKGNAME is modified. This is already true for almost all current uses.
Developers that know about this pitfall should then use either
${PKGNAME_REV} or ${PKGNAME_NOREV}.
Roland