diff -urN pacman-2.9.8-orig/scripts/makepkg pacman-2.9.8/scripts/makepkg
--- pacman-2.9.8-orig/scripts/makepkg	2006-01-31 00:25:03.000000000 +0000
+++ pacman-2.9.8/scripts/makepkg	2008-05-21 09:26:09.000000000 +0000
@@ -24,6 +24,8 @@
 startdir=`pwd`
 PKGDEST=$startdir
 USE_COLOR="n"
+srcdir="$startdir/src"
+pkgdir="$startdir/pkg"
 
 # Options
 BUILDSCRIPT="./PKGBUILD"
@@ -191,9 +193,9 @@
 					exit 1
 				fi
 				success=0
-				for pkgdir in $candidates; do
-					if [ -f $pkgdir/PKGBUILD ]; then
-						cd $pkgdir
+				for packdir in $candidates; do
+					if [ -f $packdir/PKGBUILD ]; then
+						cd $packdir
 						if [ "$RMDEPS" = "1" ]; then
 							makepkg -i -c -b -r -w $PKGDEST
 						else
