diff options
author | Dmitry V. Levin <ldv@altlinux.org> | 2020-06-04 08:00:00 +0000 |
---|---|---|
committer | Dmitry V. Levin <ldv@altlinux.org> | 2020-06-04 08:00:00 +0000 |
commit | 220974b148212efaae683ec1d6dc2ddd17b66be8 (patch) | |
tree | da00c68e9ffe22d67887ed84de638eda7af1e1ad /maint | |
parent | a7c47f70625b5d70d46da95539db796e38c3b59a (diff) | |
download | pam-220974b148212efaae683ec1d6dc2ddd17b66be8.tar.gz pam-220974b148212efaae683ec1d6dc2ddd17b66be8.tar.bz2 pam-220974b148212efaae683ec1d6dc2ddd17b66be8.zip |
maint: introduce gen-tag-message
* maint/gen-tag-message: New script for preparing tag message.
Diffstat (limited to 'maint')
-rwxr-xr-x | maint/gen-tag-message | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/maint/gen-tag-message b/maint/gen-tag-message new file mode 100755 index 00000000..f84cb8db --- /dev/null +++ b/maint/gen-tag-message @@ -0,0 +1,33 @@ +#!/bin/sh -efu +# Copyright (c) 2017-2020 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: LGPL-2.1-or-later + +get_commit_id() +{ + git rev-parse --verify "$1^{commit}" +} + +id="$(get_commit_id "${1:-@}")" + +tmpf= +cleanup() +{ + trap - EXIT + [ -z "$tmpf" ] || + rm -f -- "$tmpf" + exit "$@" +} + +trap 'cleanup $?' EXIT +trap 'cleanup 1' HUP PIPE INT QUIT TERM +tmpf="$(mktemp -t "${0##*/}.XXXXXX")" + +git show "$id:NEWS" > "$tmpf" +marker='^Release \([^ ]\+\)$' +vers="$(sed -n "/$marker/ {s/$marker/\\1/p;q}" "$tmpf")" + +printf 'Linux-PAM release %s\n\n' "$vers" + +sed "0,/$marker/d;/$marker/,\$d" "$tmpf" |