]> git.proxmox.com Git - pve-eslint.git/commitdiff
add small script to help extracting more relevant changes
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 8 Jun 2021 09:35:11 +0000 (11:35 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 8 Jun 2021 09:38:50 +0000 (11:38 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
debian/scripts/prepare-changes.sh [new file with mode: 0755]

diff --git a/debian/scripts/prepare-changes.sh b/debian/scripts/prepare-changes.sh
new file mode 100755 (executable)
index 0000000..b6f1df5
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+set -eu -o pipefail
+
+if [[ $1 =~ ^-(h|-help)$ ]]; then
+    echo "usage: $0 [<FROM-VERSION>]"
+    echo ""
+    echo "Filter out irrelevant entries (sponsors, chore, docs) from the upstream changelog."
+    exit 0
+fi
+
+repo="$(git rev-parse --show-toplevel)"
+
+cfn="$repo/changes.new.tmp"
+
+cp "$repo/eslint/CHANGELOG.md" "$cfn"
+
+sed -ri 's/^\* \S+ /+ /g' "$cfn"
+
+sed -i '/ Sponsors: /d' "$cfn"
+sed -i '/ Chore: /d' "$cfn"
+sed -i '/ Docs: /d' "$cfn"
+
+if [[ $1 ]]; then
+   version="$1"
+   sed -i "/^$version -/Q" "$cfn"
+   sed -i '/^\+ /!d' "$cfn"
+fi
+
+mv "$cfn" "$repo/changes"
+
+echo "trimmed changes available at '$repo/changes'"