diff options
author | Fernando Ortiz | 2020-03-19 00:26:39 -0500 |
---|---|---|
committer | Fernando Ortiz | 2020-03-19 00:26:39 -0500 |
commit | 679e7c25aab210cac51285c329ccba6821c752a7 (patch) | |
tree | 3ce1c78a2da3e8facfe048cf6315a666c0a7d864 /update.sh | |
parent | 3e1e06678d6145d4900abe0cedc8fa74eb548db1 (diff) | |
download | aur-679e7c25aab210cac51285c329ccba6821c752a7.tar.gz |
Version 1.0.3
Diffstat (limited to 'update.sh')
-rwxr-xr-x | update.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/update.sh b/update.sh new file mode 100755 index 000000000000..ff5d2422df42 --- /dev/null +++ b/update.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +latest_version=$1 +current_version=$(cat PKGBUILD | grep pkgver= | awk -F'=' '{print $2}') + +if ! [ "$latest_version" = "$current_version" ]; then + echo Updating the package with the latest version + echo latest: $latest_version + echo current: $current_version + sed -i.bak "s/$current_version/$latest_version/g" PKGBUILD + sed -i.bak "s/pkgrel=[^d.]/pkgrel=1/g" PKGBUILD + ./pkgsum.sh + if which makepkg &> /dev/null; then + makepkg --printsrcinfo > .SRCINFO + else + mksrcinfo + fi + rm -f *.bak +else + echo Nothing to update. +fi |