2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-22 09:57:41 +00:00

[#3530] Address review

- Add @ to suppress Makefile output.
- Warn about file already existing and exit.
- Use template file as base.
This commit is contained in:
Andrei Pavel 2025-01-10 17:47:16 +02:00
parent 4c0a08be3b
commit 079e0352ae
No known key found for this signature in database
GPG Key ID: D4E804481939CB21
2 changed files with 11 additions and 6 deletions

View 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

View File

@ -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}"