summaryrefslogtreecommitdiff
path: root/mk/misc
diff options
context:
space:
mode:
authorgdt <gdt>2007-08-02 11:52:14 +0000
committergdt <gdt>2007-08-02 11:52:14 +0000
commit5a5668c2f50095a6d94ce9038adcecc6827d0fe8 (patch)
treed075ae08988961be65fc324ed4a40aed9212f9aa /mk/misc
parent10524a726cb195cb518c23acf6c3a19dc137a71a (diff)
downloadpkgsrc-5a5668c2f50095a6d94ce9038adcecc6827d0fe8.tar.gz
Add wiz's request, add a changes-entry-noupdate that has the old
behavior of just appending to the file without cvs update (or cvs edit if not writable), for the convenience of those committing multiple package updates at once. To implement this, split the update/cat/commit into elementary targets and compose them to form the user-exposed targets, spiff up the comments, and rationalize .PHONY usage.
Diffstat (limited to 'mk/misc')
-rw-r--r--mk/misc/developer.mk35
1 files changed, 26 insertions, 9 deletions
diff --git a/mk/misc/developer.mk b/mk/misc/developer.mk
index 040821be0ed..44e60053377 100644
--- a/mk/misc/developer.mk
+++ b/mk/misc/developer.mk
@@ -1,9 +1,12 @@
-# $NetBSD: developer.mk,v 1.8 2007/07/28 12:23:17 gdt Exp $
+# $NetBSD: developer.mk,v 1.9 2007/08/02 11:52:14 gdt Exp $
#
# Public targets for developers:
#
-# changes-entry:
+# changes-entry-noupdate:
# Appends a correctly-formatted entry to the pkgsrc CHANGES file.
+# The CHANGES file is presumed to be up to date and writable.
+# Note that the first assumption is often wrong and that the
+# second is wrong for those that set CVSREAD.
#
# Command-line variables:
#
@@ -29,10 +32,12 @@
# % cd /usr/pkgsrc/category/package
# % make changes-entry CTYPE=Added
#
-# commit-changes-entry:
-# cce:
-# Like the above, plus the CHANGES file is committed.
+# changes-entry:
+# Like changes-entry-noupdate, plus the CHANGES file is updated,
+# and if not writable, "cvs edit" is done.
#
+# commit-changes-entry cce:
+# Like changes-entry, plus the CHANGES file is committed.
CTYPE?= Updated
NETBSD_LOGIN_NAME?= ${_NETBSD_LOGIN_NAME_cmd:sh}
@@ -67,21 +72,33 @@ _CE_ERRORS+= "[developer.mk] Invalid value "${CTYPE:Q}" for CTYPE."
_CE_MSG2= [${NETBSD_LOGIN_NAME} ${_CDATE_cmd:sh}]
_CE_MSG= ${_CE_MSG1} ${_CE_MSG2}
-.PHONY: changes-entry
-changes-entry: ce-error-check
+# Targets for the update, add, commit elementary operations.
+changes-entry-update: .PHONY ce-error-check
@${STEP_MSG} "Updating ${PKGSRC_CHANGES:T}"
${RUN} cd ${PKGSRC_CHANGES_DIR} && cvs update ${PKGSRC_CHANGES:T}
${RUN} cd ${PKGSRC_CHANGES_DIR} && test -w ${PKGSRC_CHANGES:T} || cvs edit ${PKGSRC_CHANGES:T}
+
+changes-entry-add: .PHONY ce-error-check
@${STEP_MSG} "Adding the change"
${RUN} ${ECHO} " "${_CE_MSG:Q} >> ${PKGSRC_CHANGES}
-commit-changes-entry cce: .PHONY ce-error-check changes-entry
+changes-entry-commit: .PHONY ce-error-check
@${STEP_MSG} "Committing the change"
${RUN} cd ${PKGSRC_CHANGES_DIR} && cvs commit -m ${_CE_MSG1:Q} ${PKGSRC_CHANGES:T}
-ce-error-check:
+ce-error-check: .PHONY
.if defined(_CE_ERRORS) && !empty(_CE_ERRORS:M*)
${RUN} for msg in ${_CE_ERRORS}; do ${ERROR_MSG} "$$msg"; done; exit 1
.else
@${DO_NADA}
.endif
+
+# Public targets
+changes-entry-noupdate: .PHONY ce-error-check changes-entry-add
+ @${DO_NADA}
+
+changes-entry: .PHONY ce-error-check changes-entry-update changes-entry-add
+ @${DO_NADA}
+
+commit-changes-entry cce: .PHONY ce-error-check changes-entry-update changes-entry-add changes-entry-commit
+ @${DO_NADA}