Subject: CHANGES files and cvs
To: None <tech-pkg@netbsd.org>
From: Greg Troxel <gdt@ir.bbn.com>
List: tech-pkg
Date: 10/03/2006 13:13:18
--=-=-=
Content-Transfer-Encoding: quoted-printable


'make changes-entry' currently appends a line to
pkgsrc/doc/CHANGES-2006.   I have two problems with this:

1) I use cvs with CVSREAD=3Dt in my environment, so all my checked-out
files are 444 until I do 'cvs edit' from the shell, or more likely M-x
vc-toggle-read-only.  This helps prevent accidental changes, as well
as records a kind of watch on the file ('cvs editors', and the mail
one gets when someone commits to a file I'm editing).  So CHANGES-2006
is always 444, and I have to go cvs edit it first.

2) I tend to 'cvs update' in pkgsrc every week or so, and sometimes
update a package in that state, doing cvs up in the pkg dir but not
the whole tree first.  Even if I cvs update, sometimes by the time
I've tested for an hour someone else will have committed to
CHANGES-yyyy.


So, as I see it, the steps to take after committing to a package are

1) (cd ../../doc && cvs update)
(IMHO, needed for everyone)

2) (cd ../../doc && cvs edit CHANGES-2006)
(needed for those who set CVSREAD)

The following patch makes changes-entry do what I want.  I'm guessing
some will object, so I'd like to understand the objections so I can
modify it to be ok - perhaps turning on this behavior only if a
variable is set (or turning it off if a variable is set, depending on
the prevailing view) is rw (probably a good idea).

Index: mk/bsd.pkg.mk
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvsroot/pkgsrc/mk/bsd.pkg.mk,v
retrieving revision 1.1885
diff -u -r1.1885 bsd.pkg.mk
=2D-- mk/bsd.pkg.mk	3 Oct 2006 14:22:16 -0000	1.1885
+++ mk/bsd.pkg.mk	3 Oct 2006 17:12:33 -0000
@@ -897,7 +897,8 @@
 #
 CTYPE?=3D			Updated
 NETBSD_LOGIN_NAME?=3D	${_NETBSD_LOGIN_NAME_cmd:sh}
=2DPKGSRC_CHANGES?=3D	${PKGSRCDIR}/doc/CHANGES-${_CYEAR_cmd:sh}
+PKGSRC_CHANGES_BASE?=3D	CHANGES-${_CYEAR_cmd:sh}
+PKGSRC_CHANGES?=3D	${PKGSRCDIR}/doc/${PKGSRC_CHANGES_BASE}
=20
 _CYEAR_cmd=3D		${DATE} -u +%Y
 _CDATE_cmd=3D		${DATE} -u +%Y-%m-%d
@@ -918,6 +919,9 @@
 .PHONY: changes-entry
 changes-entry:
 	${_PKG_SILENT}${_PKG_DEBUG}					\
+	(cd ${PKGSRCDIR}/doc; \
+	cvs up ${PKGSRC_CHANGES_BASE:Q}; \
+	test -w ${PKGSRC_CHANGES_BASE:Q} || cvs edit ${PKGSRC_CHANGES_BASE:Q})
 	${ECHO} ${_CTYPE1}${_CTYPE2}${_CTYPE3} >> ${PKGSRC_CHANGES:Q}
=20
 .include "${PKGSRCDIR}/mk/internal/build-defs-message.mk"

--=-=-=
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (NetBSD)

iD8DBQFFIpoy+vesoDJhHiURAoUkAJsFOBElRd2IkXfWyENsEln5MmwgpgCeKS0Q
9zPhwfDPmX15pU2ziTqx4NQ=
=Z/0P
-----END PGP SIGNATURE-----
--=-=-=--