intellij-idea-community/update-new-version.sh

42 lines
1.1 KiB
Bash
Raw Normal View History

2016-10-06 11:11:39 +02:00
#!/bin/bash
function main {
local old=$1
local new=$2
local now=`date -R`
local author=`git config --get user.name`
local email=`git config --get user.email`
local username=`git config --get remote.origin.url | sed 's,.*:\(.*\)/.*,\1,'`
local tempfile=`tempfile`
git checkout -b version-$new
mv intellij-idea-community_{$old,$new}
mv intellij-idea-community_{$old,$new}.orig.tar.gz
# 4. Edit README.md to update latest version number.
sed "s/$old/$new/g" ./README.md > ./README.md.tmp
mv ./README.md.tmp ./README.md
2017-08-31 00:47:12 +02:00
echo "intellij-idea-community ($new-1) artful; urgency=low
2016-10-06 11:11:39 +02:00
* Upstream Version $new
2017-08-31 00:24:08 +02:00
-- $author ($username) <$email> $now
2016-10-06 11:11:39 +02:00
" >> $tempfile
cat intellij-idea-community_$new/debian/changelog >> $tempfile
mv $tempfile intellij-idea-community_$new/debian/changelog
sed -i "s/$old/$new/g" intellij-idea-community_$new/debian/preinst
(cd intellij-idea-community_$new/ && debuild -us -uc )
rm intellij-idea-community_${old}*
sudo dpkg -i intellij-idea-community_$new-1_all.deb
}
main $1 $2