diff options
author | Iván Ávalos <avalos@disroot.org> | 2024-07-23 12:06:33 -0600 |
---|---|---|
committer | Iván Ávalos <avalos@disroot.org> | 2024-07-23 12:06:33 -0600 |
commit | 7c386bab211dbd475bbfbeb746642b75d6425a9d (patch) | |
tree | 7dd2b6e4389658dbf90af5cda5af237074a2bc61 | |
parent | 4c42707989ab3b2b4b7636e0082ad8bc21dca21a (diff) |
add bump version script
bug 0008994
-rwxr-xr-x | contrib/bump-taler-version.sh | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/contrib/bump-taler-version.sh b/contrib/bump-taler-version.sh new file mode 100755 index 00000000..3d770de3 --- /dev/null +++ b/contrib/bump-taler-version.sh @@ -0,0 +1,49 @@ +#!/usr/bin/env bash +set -eu + +if [ $# != 1 ]; then + >&2 echo "Illegal number of arguments" + >&2 echo "Usage: $0 <version>" + exit -1 +fi + +VERSION="$1" +DATE="$(date -R)" +GIT_USER="$(git config user.name)" +GIT_EMAIL="$(git config user.email)" + +function updated { + local FILE=$1 + if [[ $(grep "${VERSION}" "${FILE}") ]]; then + echo "${FILE} already in ${VERSION}" + return -1 + fi +} + +# update configure.ac +function configure_ac { + updated configure.ac || return 0 + + sed -i "/AC_INIT/s/,\\[\\(.*\\)\\],/,[${VERSION}],/" configure.ac + echo "configure.ac ${VERSION}" +} + +# update debian/changelog +function debian_changelog { + updated debian/changelog || return 0 + + cat <<EOF > ./debian/changelog.tmp +taler-merchant (${VERSION}) unstable; urgency=low + + * Release ${VERSION}. + + -- ${GIT_USER} <${GIT_EMAIL}> ${DATE} + +EOF + cat ./debian/changelog >> ./debian/changelog.tmp + mv ./debian/changelog.tmp ./debian/changelog + echo "debian/changelog ${VERSION}" +} + +configure_ac +debian_changelog |