2018-04-02 08:52:48 +02:00
|
|
|
#!/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-ultimate"
|
2018-11-25 23:26:53 +01:00
|
|
|
DISTRIBUTION="cosmic"
|
2018-04-02 08:52:48 +02:00
|
|
|
|
|
|
|
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 ..
|
|
|
|
|
2018-12-09 23:50:25 +01:00
|
|
|
rm -rf "$PACKAGE"_"$old"-*
|
2018-04-02 08:52:48 +02:00
|
|
|
|
|
|
|
# disabled until it is only called with an specific argument
|
|
|
|
# sudo dpkg -i "$PACKAGE"_"$new"-1_all.deb
|
|
|
|
}
|
|
|
|
|
|
|
|
main "$1" "$2"
|