tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Fix +BUILD_VERSION generation



There are a few packages, notably erlang, that contain multiple
"$NetBSD" strings, resulting in multiple entries in +BUILD_VERSION:

  $ pkg_info -b erlang-22.0.7nb1.tgz | grep 'Makefile:'
  lang/erlang/Makefile:	$NetBSD: Makefile,v 1.95 2019/08/11 13:21:19 wiz Exp $
  lang/erlang/Makefile:	$NetBSD\$$" > $

This conflicts with pbulk's check for whether $NetBSD$ has changed,
and so any of you that run bulk builds will probably have noticed that
erlang (and all its reverse dependencies) are rebuilt for every single
build.  The same thing happens for a few other packages that I can't
recall off the top of my head due to similar reasons.

The fix is straight-forward, and mostly matches what pbulk does (i.e
only consider the first match):

  Index: mk/pkgformat/pkg/metadata.mk
  ===================================================================
  RCS file: /cvsroot/pkgsrc/mk/pkgformat/pkg/metadata.mk,v
  retrieving revision 1.16
  diff -u -r1.16 metadata.mk
  --- mk/pkgformat/pkg/metadata.mk	28 May 2019 13:32:06 -0000	1.16
  +++ mk/pkgformat/pkg/metadata.mk	24 Sep 2019 19:28:34 -0000
  @@ -160,7 +160,7 @@
   	${CAT} ${.TARGET}.tmp |						\
   	while read file; do						\
   		${GREP} '\$$NetBSD' $$file 2>/dev/null |		\
  -		${SED} -e "s|^|$$file:|";				\
  +		${SED} -e "s|^|$$file:|;q";				\
   	done |								\
   	${AWK} '{ sub("^${PKGSRCDIR}/", "");				\
   		  sub(":.*[$$]NetBSD", ":	$$NetBSD");		\

I know this is an infrastructure change so happy for it to wait until
after the freeze, but at the same time it's relatively low risk so we
might want it anyway.

-- 
Jonathan Perkin  -  Joyent, Inc.  -  www.joyent.com


Home | Main Index | Thread Index | Old Index