summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxim Baz2017-03-04 12:32:00 +0100
committerMaxim Baz2017-03-04 12:32:00 +0100
commit2a69df83146b354bbe2ac3b9ee1ff5b6435c78b0 (patch)
treef831c10238d69a00d8d95feb0890d931a815abb9
parentf1adb8d2e6742f2464dd5d85efd8a4bc16f75df8 (diff)
downloadaur-2a69df83146b354bbe2ac3b9ee1ff5b6435c78b0.tar.gz
Bump version
-rw-r--r--.SRCINFO6
-rw-r--r--PKGBUILD4
-rwxr-xr-xupgrade.sh61
3 files changed, 60 insertions, 11 deletions
diff --git a/.SRCINFO b/.SRCINFO
index e97a86b554e1..e5fc563f5f60 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = cerebro
pkgdesc = Open-source productivity booster with a brain.
- pkgver = 0.2.6
+ pkgver = 0.2.7
pkgrel = 1
url = https://cerebroapp.com/
arch = x86_64
@@ -16,8 +16,8 @@ pkgbase = cerebro
depends = nss
provides = cerebro
conflicts = cerebro-git
- source = 0.2.6.tar.gz::https://github.com/KELiON/cerebro/archive/0.2.6.tar.gz
- sha256sums = 0becadc20e50a3e83c58c7cb3e07443724189f7002368b59629befb654145c5b
+ source = 0.2.7.tar.gz::https://github.com/KELiON/cerebro/archive/0.2.7.tar.gz
+ sha256sums = 03908840bf46bf4761c12601e6d1bdd2f7d79ed8c890b47916f0a1931398a888
pkgname = cerebro
diff --git a/PKGBUILD b/PKGBUILD
index 658c00c53eb7..2bbdd2b7a817 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,6 +1,6 @@
# Maintainer: Maxim Baz <cerebro@maximbaz.com>
pkgname=cerebro
-pkgver=0.2.6
+pkgver=0.2.7
pkgrel=1
pkgdesc='Open-source productivity booster with a brain.'
arch=('x86_64' 'i686')
@@ -11,7 +11,7 @@ depends=('alsa-lib' 'gconf' 'gtk2' 'libxss' 'libxtst' 'nss')
makedepends=('gendesk' 'npm')
provides=('cerebro')
source=("${pkgver}.tar.gz::https://github.com/KELiON/cerebro/archive/"$pkgver".tar.gz")
-sha256sums=('0becadc20e50a3e83c58c7cb3e07443724189f7002368b59629befb654145c5b')
+sha256sums=('03908840bf46bf4761c12601e6d1bdd2f7d79ed8c890b47916f0a1931398a888')
prepare() {
gendesk -f -n --name=Cerebro --pkgname="${pkgname}" --pkgdesc="${pkgdesc}" --exec="${pkgname}" --categories="System"
diff --git a/upgrade.sh b/upgrade.sh
index 029ed6fdd80b..0d51737f1d6e 100755
--- a/upgrade.sh
+++ b/upgrade.sh
@@ -1,13 +1,62 @@
#!/bin/bash
-version="$1"
-if [ -z "$version" ]; then
- echo -e "Usage: ./upgrade.sh <version>\nExample: ./upgrade.sh 1.2.3"
- exit 1
+set -e
+cd "$(dirname "$0")"
+
+repo='KELiON/cerebro'
+echo "Updating $repo"
+
+git clean -fdx
+git pull
+
+newver=$(curl -s -N "https://github.com/$repo/releases.atom" | grep -m 1 -o '/releases/.*' | sed -e 's/\/releases\/tag\/\(.*\)"\/>/\1/');
+oldver=$(grep -a 'pkgver=' PKGBUILD | sed 's/pkgver=//g')
+
+oldpure=$(echo "$oldver" | sed -e 's/\.//g;s/-//g')
+newpure=$(echo "$newver" | sed -e 's/\.//g;s/-//g')
+
+echo "Comparing $oldpure and $newpure."
+if [ "$newpure" -le "$oldpure" ]; then
+ echo 'Nothing to upgrade.'
+ exit 0
fi
-cd "$(dirname "$0")"
-sed -i 's/^pkgver.*/pkgver='$version'/' PKGBUILD
+
+echo "Upgrading: $oldver -> $newver"
+
+# Update files
+sed -i "s/^pkgver.*/pkgver=$newver/" PKGBUILD
+sed -i 's/^pkgrel.*/pkgrel=1/' PKGBUILD
updpkgsums
makepkg --printsrcinfo > .SRCINFO
+# Make sure package can build
+makepkg --cleanbuild
+
+# Cleanup install files
+find . -name '*.tar.gz' -exec rm {} \;
+rm -rf src pkg
+
+# Install the package
+pkg=$(find . -name '*.pkg.tar.xz')
+expect <<EOF
+ set send_slow {1 .1}
+ proc send {ignore arg} {
+ sleep .1
+ exp_send -s -- \$arg
+ }
+ set timeout 120
+ spawn sudo pacman -U $pkg
+ expect {
+ -exact " are in conflict. Remove " { send -- "y\r"; exp_continue }
+ -exact "installation? \[Y/n\]" { send -- "y\r"; exp_continue }
+ }
+EOF
+
+# Push changes
+git add PKGBUILD
+git add .SRCINFO
+git commit -m 'Bump version'
+git push
+
+echo "Update completed."