[pacman-dev] [PATCH] makepkg: fix updating PKGBUILD when building SCM packages

Allan McRae allan at archlinux.org
Tue Oct 28 07:48:23 EDT 2008


Fixes a bug and resets pkgrel to 1 when bumping pkgver

Signed-off-by: Allan McRae <allan at archlinux.org>
---
 scripts/makepkg.sh.in |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 5735891..52784b6 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1094,6 +1094,7 @@ devel_check() {
 		if [ "$newpkgver" != "" ]; then
 			msg2 "$(gettext "Version found: %s")" "$newpkgver"
 			pkgver=$newpkgver
+			pkgrel=1
 		fi
 
 	else
@@ -1113,8 +1114,9 @@ devel_update() {
 	#  _foo=pkgver
 	#
 	if [ "$newpkgver" != "" ]; then
-		if [ "newpkgver" != "$pkgver" ]; then
+		if [ "$newpkgver" != "$pkgver" ]; then
 			sed -i "s/^pkgver=[^ ]*/pkgver=$newpkgver/" ./$BUILDSCRIPT
+			sed -i "s/^pkgrel=[^ ]*/pkgrel=1/" ./$BUILDSCRIPT
 			source $BUILDSCRIPT
 		fi
 	fi
-- 
1.6.0.3




More information about the pacman-dev mailing list