pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk General improvements to the changes-entry target:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/aa20779363d5
branches:  trunk
changeset: 495433:aa20779363d5
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Thu Jun 09 16:26:23 2005 +0000

description:
General improvements to the changes-entry target:

* Improve the documentation.
* Avoid running commands during Makefile processing by using the :sh
  modifier instead of defining variables using !=
* Add a new variable PKGSRC_CHANGES that holds the path to the CHANGES
  file to be modified.
* Use ${ID} and ${DATE}, which are provided by the tools framework and
  avoid PATH issues.

diffstat:

 mk/bsd.pkg.mk |  30 ++++++++++++++++++++----------
 1 files changed, 20 insertions(+), 10 deletions(-)

diffs (60 lines):

diff -r fd4150bc8d3f -r aa20779363d5 mk/bsd.pkg.mk
--- a/mk/bsd.pkg.mk     Thu Jun 09 16:09:58 2005 +0000
+++ b/mk/bsd.pkg.mk     Thu Jun 09 16:26:23 2005 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.pkg.mk,v 1.1691 2005/06/09 16:09:58 jlam Exp $
+#      $NetBSD: bsd.pkg.mk,v 1.1692 2005/06/09 16:26:23 jlam Exp $
 #
 # This file is in the public domain.
 #
@@ -4845,7 +4845,8 @@
 .  endif
 .endfor
 
-# changes-entry appends an entry to pkgsrc/doc/CHANGES.
+# changes-entry appends a correctly-formatted entry to the pkgsrc
+# CHANGES file.
 #
 # The following variables may be set:
 #
@@ -4855,12 +4856,22 @@
 #    NETBSD_LOGIN_NAME is the login name assigned by the NetBSD Project.
 #      It defaults to the local login name.
 #
+#    PKGSRC_CHANGES is the path to the CHANGES file to which the entry
+#      is appended.  It defaults to ${PKGSRCDIR}/doc/CHANGES.
+#
 # Example usage:
 #
-#      cd /usr/pkgsrc/category/package
-#      make changes-entry CTYPE=Added
+#      % cd /usr/pkgsrc/category/package
+#      % make changes-entry CTYPE=Added
 #
-CTYPE?=        Updated
+CTYPE?=                        Updated
+NETBSD_LOGIN_NAME?=    ${_NETBSD_LOGIN_NAME_cmd:sh}
+PKGSRC_CHANGES?=       ${PKGSRCDIR}/doc/CHANGES
+
+_CDATE_cmd=            ${DATE} -u +%Y-%m-%d
+_NETBSD_LOGIN_NAME_cmd=        ${ID} -nu
+
+_CTYPE1=       "       "${CTYPE:Q}" "${PKGPATH:Q}
 .if !empty(CTYPE:MUpdated)
 _CTYPE2=       " to "${PKGVERSION:Q}
 .elif !empty(CTYPE:MAdded)
@@ -4870,10 +4881,9 @@
 .else
 _CTYPE2=
 .endif
-# override in /etc/mk.conf with your NetBSD login if different
-NETBSD_LOGIN_NAME?=    `id -nu`
-CDATE!=                date -u +%Y-%m-%d
+_CTYPE3=       " ["${NETBSD_LOGIN_NAME:Q}" "${_CDATE_cmd:sh:Q}"]"
+
 .PHONY: changes-entry
 changes-entry:
-       @${ECHO} "      "${CTYPE:Q}" "${PKGPATH:Q}${_CTYPE2}" [${NETBSD_LOGIN_NAME} "${CDATE:Q}"]"\
-               >> ${_PKGSRCDIR}/doc/CHANGES
+       ${_PKG_SILENT}${_PKG_DEBUG}                                     \
+       ${ECHO} ${_CTYPE1}${_CTYPE2}${_CTYPE3} >> ${PKGSRC_CHANGES:Q}



Home | Main Index | Thread Index | Old Index