diff --git a/tools/bump-changelog.sh b/tools/bump-changelog.sh index a101e4b..61a8b26 100755 --- a/tools/bump-changelog.sh +++ b/tools/bump-changelog.sh @@ -13,19 +13,20 @@ if [ "${VERSION}" = "${CURRENT}" ]; then echo "Changelog already at ${VERSION}." else # dch identity: prefer the package maintainer (single source of truth in - # debian/control). Setting DEBNAME/DEBEMAIL keeps dch non-interactive -- - # without them dch prints warnings and waits for a keypress, which would - # hang unattended builds. + # debian/control). Setting DEBFULLNAME/DEBEMAIL keeps dch non-interactive + # (it takes the name from DEBFULLNAME, not DEBNAME) -- without them dch + # prints warnings and waits for a keypress, which would hang unattended + # builds. MAINTAINER="$(sed -nE 's/^Maintainer:[[:space:]]*(.*)$/\1/p' "${ROOT}/debian/control" | head -n1)" EMAIL_RE='<([^>]+)>' if [[ "${MAINTAINER}" =~ ${EMAIL_RE} ]]; then - NAME="${MAINTAINER%% <}*" + NAME="${MAINTAINER%%" <"*}" EMAIL="${BASH_REMATCH[1]}" else NAME="$(git -C "${ROOT}" config user.name || echo maintainer)" EMAIL="$(git -C "${ROOT}" config user.email || echo maintainer@example.com)" fi - DEBNAME="${NAME}" DEBEMAIL="${EMAIL}" \ + DEBFULLNAME="${NAME}" DEBEMAIL="${EMAIL}" \ dch --distribution noble -v "${VERSION}" \ "Bumped to rolling version ${VERSION}." fi