From 410f35b19e6c22287b918b172f21aa179656f158 Mon Sep 17 00:00:00 2001 From: Ark74 Date: Mon, 14 Jul 2025 01:13:28 -0600 Subject: [PATCH] config: add simple multi-line support changelog. --- helpers/config | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/helpers/config b/helpers/config index 3172b67..a1b0ab8 100755 --- a/helpers/config +++ b/helpers/config @@ -81,12 +81,35 @@ pkgversion(){ replace(){ find ${@:3} -type f -not -iregex '.*changelog.*' -not -iregex '.*copyright.*' -execdir /bin/sed --follow-symlinks -i s^"$1"^"$2"^g {} \; } +changelog_multiline() { + local msg="$1" + local version="${2:-$FULLVERSION}" + local dist="${3:-$REPO}" + + # Iniciar changelog si la versión aún no está + if ! grep -q "$version" debian/changelog 2>/dev/null; then + dch -v "$version" -D "$dist" "" + fi + + local count=0 + + while IFS= read -r line || [ -n "$line" ]; do + dch -a "$line" + count=$((count + 1)) + done <<< "$msg" + + if [ "$count" -gt 0 ]; then + dch -r "" + fi +} changelog(){ head -n 1 debian/changelog | grep -q $UPSTREAM-security && REPO=$CODENAME-security || REPO=$CODENAME [ "$SECURITY" = true ] && REPO=${CODENAME}-security [ "$BACKPORT" = true ] || [ "$BACKPORTS" = true ] && REPO=${CODENAME}-backports -#Name convention issue "+" breaking packages build like console-setup, using "-" instead. -echo | dch -D $REPO -v $FULLVERSION "$1" + + local msg="$1" + + changelog_multiline "$msg" "$FULLVERSION" "$REPO" # Make sure the changelog file is identical between archs /bin/sed "/-- Trisquel/s/.*/ -- Trisquel GNU\/Linux developers $DATE/" -i debian/changelog