2019-05-16 12:22:46 +02:00
|
|
|
#!/bin/sh
|
2017-02-10 17:14:33 +01:00
|
|
|
|
2019-05-16 12:22:46 +02:00
|
|
|
# This script intends to decrease the effort of updating the package.
|
2017-02-10 17:14:33 +01:00
|
|
|
|
2019-05-16 12:22:46 +02:00
|
|
|
PACKAGE="intellij-idea-ultimate"
|
2021-05-04 19:56:47 +02:00
|
|
|
DISTRIBUTION="hirsute"
|
2017-02-10 17:14:33 +01:00
|
|
|
|
2019-05-16 12:22:46 +02:00
|
|
|
main() {
|
2020-03-29 13:34:22 +02:00
|
|
|
last_tag=$(git describe --abbrev=0 --tags)
|
|
|
|
old="${last_tag#?}"
|
|
|
|
new="$1"
|
2019-05-16 12:22:46 +02:00
|
|
|
name="$(git config --get user.name)"
|
|
|
|
email="$(git config --get user.email)"
|
2017-02-10 17:14:33 +01:00
|
|
|
|
2019-05-16 12:22:46 +02:00
|
|
|
git checkout -b version-"$new"
|
2017-02-10 17:14:33 +01:00
|
|
|
|
2019-05-16 12:22:46 +02:00
|
|
|
mv "$PACKAGE"_"$old" "$PACKAGE"_"$new"
|
|
|
|
mv "$PACKAGE"_"$old".orig.tar.gz "$PACKAGE"_"$new".orig.tar.gz
|
2017-02-10 17:14:33 +01:00
|
|
|
|
2019-05-16 12:22:46 +02:00
|
|
|
cd "$PACKAGE"_"$new" || exit
|
2017-02-10 17:14:33 +01:00
|
|
|
|
2019-05-16 12:22:46 +02:00
|
|
|
# Update the debian/changelog file with dch
|
|
|
|
NAME="$name" EMAIL="$email" dch \
|
|
|
|
--newversion "$new"-1 \
|
|
|
|
--distribution "$DISTRIBUTION" \
|
|
|
|
"Upstream version $new"
|
2017-02-10 17:14:33 +01:00
|
|
|
|
2019-05-16 12:22:46 +02:00
|
|
|
sed -i "s/$old/$new/g" ./debian/preinst
|
2021-10-01 19:53:28 +02:00
|
|
|
sed -i "s/$old/$new/g" ./debian/postinst
|
2017-02-10 17:14:33 +01:00
|
|
|
|
2019-05-16 12:22:46 +02:00
|
|
|
debuild -us -uc
|
2017-02-10 17:14:33 +01:00
|
|
|
|
2019-05-16 12:22:46 +02:00
|
|
|
cd ..
|
2017-02-10 17:14:33 +01:00
|
|
|
|
2019-05-16 12:22:46 +02:00
|
|
|
rm -rf "$PACKAGE"_"$old"-*
|
2017-02-10 17:14:33 +01:00
|
|
|
|
2019-05-16 12:22:46 +02:00
|
|
|
# disabled until it is only called with an specific argument
|
|
|
|
# sudo dpkg -i "$PACKAGE"_"$new"-1_all.deb
|
|
|
|
}
|
2017-02-10 17:14:33 +01:00
|
|
|
|
2020-03-29 13:34:22 +02:00
|
|
|
main "$1"
|