summarylogtreecommitdiffstats
path: root/update.sh
blob: bde7d343a8f3b1d7e12f3ee1e2440d55ce3b86ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash

read -p "Enter the new pkgver: " pkgver
read -p "Enter the new pkgrel: " pkgrel

sed -i "s/^pkgver=.*$/pkgver=${pkgver}/" ./PKGBUILD
sed -i "s/^pkgrel=.*$/pkgrel=${pkgrel}/" ./PKGBUILD

if ! git diff --quiet HEAD PKGBUILD; then

  if pacman -Qi pacman-contrib > /dev/null 2>&1; then
    updpkgsums
  else
    echo "Install pacman-contrib with 'pacman -S pacman-contrib'"
    exit 1
  fi

  makepkg --printsrcinfo > .SRCINFO

  makepkg -si

  git add PKGBUILD .SRCINFO

  git commit -m "Updated version to ${pkgver}-${pkgrel}"
else
  echo "No updates found!"
fi