]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3530] Address review
authorAndrei Pavel <andrei@isc.org>
Fri, 10 Jan 2025 15:47:16 +0000 (17:47 +0200)
committerAndrei Pavel <andrei@isc.org>
Fri, 10 Jan 2025 15:47:16 +0000 (17:47 +0200)
- Add @ to suppress Makefile output.
- Warn about file already existing and exit.
- Use template file as base.

Makefile.am
changelog_unreleased/.add-entry.sh

index 7675376cdd91aa3b6c9536bc8ca51b0e9d2d228e..466028f67635b7be7768b5359a6d3beb0b285b66 100644 (file)
@@ -180,7 +180,7 @@ install-exec-hook:
        mkdir -p $(DESTDIR)${runstatedir}/${PACKAGE_NAME}
 
 add-changelog-entry:
-       ./changelog_unreleased/.add-entry.sh
+       @./changelog_unreleased/.add-entry.sh
 
 #### include external sources in the distributed tarball:
 EXTRA_DIST = ext/coroutine/coroutine.hpp
index 863aa8467d2501e61d1ad7f86bdf593ce401f01a..c64168805690e1b9dd652cec1c492c1bd895524c 100755 (executable)
@@ -4,12 +4,17 @@ set -eu
 
 parent_dir=$(cd "$(dirname "${0}")" && pwd)
 cd "${parent_dir}" || exit 1
+basedir=$(basename "${parent_dir}")
 
 author=$(git show -s --format='%ae' | cut -d '@' -f 1)
 branch=$(git branch --show-current)
-file="${branch}"
 gitlab_id=$(printf '%s' "${branch}" | cut -d '-' -f 1)
-printf '[category]\t\t%s\n' "${author}" > "${file}"
-printf '\tdescription\n' >> "${file}"
-printf '\t(Gitlab #%s)\n' "${gitlab_id}" >> "${file}"
-printf 'Created changelog_unreleased/%s.\n' "${file}"
+file="${branch}"
+if test -e "${file}"; then
+  printf 'Nothing done. File already exists: %s\n' "${basedir}/${file}"
+  exit 1
+fi
+content=$(cat .template)
+content="${content//author/${author}}"
+content="${content//#0000/#${gitlab_id}}"
+printf '%s\n' "${content}" > "${file}"