summarylogtreecommitdiffstats
path: root/prepare_update.sh
blob: 31aec902d5bacf44bea6b128a25ce29d940a5a7e (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
#!/usr/bin/env bash

if [ ! -d ".git" ]
then
	echo "Not a git repository!"
	exit 1
fi

BUILD_FILE="PKGBUILD"
if [ ! -e "$BUILD_FILE" ]
then
	echo "Not an AUR repository!"
	exit 2
fi
source "$BUILD_FILE"

if [ "$1" == "--aur-only" ]
then
	echo "Only updating \$pkgrel!"
	sed -i "s|pkgrel\=.*|pkgrel\=$((pkgrel+1))|" "$BUILD_FILE"
else
	sed -i "s|pkgrel\=.*|pkgrel\=1|" "$BUILD_FILE"
	# Have makepkg update the version using pkgver()
	makepkg --nodeps --nobuild
fi

makepkg --printsrcinfo > .SRCINFO