summaryrefslogtreecommitdiffstats
path: root/bin/git-debian-release
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-05-09 04:21:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-05-09 04:21:55 +0000
commit453cc058d9ee6d7cb47529d99061216e72149a5f (patch)
tree38e3683d9cb52c2f181d65ba513554a5e1387f20 /bin/git-debian-release
parentInitial commit. (diff)
downloadprogress-linux-tools-453cc058d9ee6d7cb47529d99061216e72149a5f.tar.xz
progress-linux-tools-453cc058d9ee6d7cb47529d99061216e72149a5f.zip
Adding bin.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-xbin/git-debian-release33
1 files changed, 33 insertions, 0 deletions
diff --git a/bin/git-debian-release b/bin/git-debian-release
new file mode 100755
index 0000000..9a7b4b7
--- /dev/null
+++ b/bin/git-debian-release
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+set -e
+
+GBP_CONF_FILES="/dev/null"
+export GBP_CONF_FILES
+
+if [ -n "$(git config --get user.signingKey)" ]
+then
+ GIT_OPTIONS="-S"
+fi
+
+if [ ! -e debian/changelog ]
+then
+ echo "E: debian/changelog - no such file" >&2
+ exit 1
+fi
+
+MODE="$(basename ${0} | sed -e 's|^git-||' -e 's|-release$||')"
+
+if [ -n "${1}" ]
+then
+ VERSION="${1}"
+else
+ VERSION="$(dpkg-parsechangelog | awk '/^Version: / { print $2 }')"
+fi
+
+HASH="${2}"
+
+git add -A
+
+git commit -a -s -m "Releasing ${MODE} version ${VERSION}." ${GIT_OPTIONS}
+git-${MODE}-tag ${VERSION} ${HASH}