From c41f6352199f5e8b57fac21e01ef1e50d98e4877 Mon Sep 17 00:00:00 2001 From: Marcel Kapfer Date: Mon, 2 Apr 2018 08:46:18 +0200 Subject: [PATCH] Reworking update-new-version script --- update-new-version2.sh | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 update-new-version2.sh diff --git a/update-new-version2.sh b/update-new-version2.sh new file mode 100755 index 0000000..f1a3d67 --- /dev/null +++ b/update-new-version2.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +# This is a ongoing rewrite of the update-new-version.sh script. +# Most important changes: POSIX compatibility, use of existing commands. +# The script intends to decrease the effort of updating the package. + +PACKAGE="intellij-idea-community" +DISTRIBUTION="artful" + +main() { + old="$1" + new="$2" + name="$(git config --get user.name)" + email="$(git config --get user.email)" + + git checkout -b version-"$new" + + mv "$PACKAGE"_"$old" "$PACKAGE"_"$new" + mv "$PACKAGE"_"$old".orig.tar.gz "$PACKAGE"_"$new".orig.tar.gz + + cd "$PACKAGE"_"$new" || exit + + # Update the debian/changelog file with dch + NAME="$name" EMAIL="$email" dch \ + --newversion "$new"-1 \ + --distribution "$DISTRIBUTION" \ + "Upstream version $new" + + sed -i "s/$old/$new/g" ./debian/preinst + + debuild -us -uc + + cd .. + + rm -rf "$PACKAGE"_"$old"* + + # disabled until it is only called with an specific argument + # sudo dpkg -i "$PACKAGE"_"$new"-1_all.deb +} + +main "$1" "$2"