From d986d167a1757fb9f13a3503b6c572e7dfc6e4c6 Mon Sep 17 00:00:00 2001 From: wiz Date: Fri, 21 Aug 2009 12:51:07 +0000 Subject: When making an entry to the CHANGES-* file using 'make changes-entry', the target now automatically also removes any TODO entries for the package that was updated. Script improved based on version by dholland; further suggestions by gdt and joerg. --- mk/misc/developer.mk | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) (limited to 'mk/misc/developer.mk') diff --git a/mk/misc/developer.mk b/mk/misc/developer.mk index 8fbe82c0aea..08a779019f3 100644 --- a/mk/misc/developer.mk +++ b/mk/misc/developer.mk @@ -1,10 +1,12 @@ -# $NetBSD: developer.mk,v 1.15 2008/11/05 08:21:56 rillig Exp $ +# $NetBSD: developer.mk,v 1.16 2009/08/21 12:51:07 wiz Exp $ # # Public targets for developers: # # 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. +# Appends a correctly-formatted entry to the pkgsrc CHANGES file, +# and removes any TODO entries that were completed with this +# update from the TODO file. +# The CHANGES and TODO files are 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. # @@ -30,13 +32,18 @@ # is appended. # The default is ${PKGSRCDIR}/doc/CHANGES-YYYY. # +# PKGSRC_TODO +# The path to the TODO file from which now possibly +# obsolete entries are removed +# The default is ${PKGSRCDIR}/TODO. +# # Example usage: # % cd /usr/pkgsrc/category/package # % make changes-entry CTYPE=Added # # changes-entry: -# Like changes-entry-noupdate, plus the CHANGES file is updated, -# and if not writable, "cvs edit" is done. +# Like changes-entry-noupdate, plus the CHANGES and TODO files +# are updated, and if not writable, "cvs edit" is done. # # commit-changes-entry: # cce: @@ -51,6 +58,7 @@ NETBSD_LOGIN_NAME?= ${_NETBSD_LOGIN_NAME_cmd:sh} PKGSRC_CHANGES_DIR= ${PKGSRCDIR}/doc/ PKGSRC_CHANGES_BASE= CHANGES-${_CYEAR_cmd:sh} PKGSRC_CHANGES?= ${PKGSRC_CHANGES_DIR}/${PKGSRC_CHANGES_BASE} +PKGSRC_TODO?= ${PKGSRC_CHANGES_DIR}/TODO _CYEAR_cmd= ${DATE} -u +%Y _CDATE_cmd= ${DATE} -u +%Y-%m-%d @@ -89,17 +97,21 @@ _CE_MSG= ${_CE_MSG1} ${_CE_MSG2} # 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} + @${STEP_MSG} "Updating ${PKGSRC_CHANGES:T} and ${PKGSRC_TODO:T}" + ${RUN} cd ${PKGSRC_CHANGES_DIR} && cvs update ${PKGSRC_CHANGES:T} ${PKGSRC_TODO:T} ${RUN} cd ${PKGSRC_CHANGES_DIR} && test -w ${PKGSRC_CHANGES:T} || cvs edit ${PKGSRC_CHANGES:T} + ${RUN} cd ${PKGSRC_CHANGES_DIR} && test -w ${PKGSRC_TODO:T} || cvs edit ${PKGSRC_TODO:T} changes-entry-add: .PHONY ce-error-check @${STEP_MSG} "Adding the change" ${RUN} ${ECHO} " "${_CE_MSG:Q} >> ${PKGSRC_CHANGES} +todo-entry-remove: + ${RUN} ${SH} ${PKGSRCDIR}/mk/scripts/remove_todo ${PKGSRC_TODO} ${PKGBASE} ${PKGVERSION} + 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} + ${RUN} cd ${PKGSRC_CHANGES_DIR} && cvs commit -m ${_CE_MSG1:Q} ${PKGSRC_CHANGES:T} ${PKGSRC_TODO:T} ce-error-check: .PHONY .if defined(_CE_ERRORS) && !empty(_CE_ERRORS:M*) @@ -109,10 +121,10 @@ ce-error-check: .PHONY .endif # Public targets -changes-entry-noupdate: .PHONY ce-error-check changes-entry-add +changes-entry-noupdate: .PHONY ce-error-check changes-entry-add todo-entry-remove @${DO_NADA} -changes-entry: .PHONY ce-error-check changes-entry-update changes-entry-add +changes-entry: .PHONY ce-error-check changes-entry-update changes-entry-add todo-entry-remove @${DO_NADA} commit-changes-entry cce: .PHONY ce-error-check changes-entry-update changes-entry-add changes-entry-commit -- cgit v1.2.3