diff --git a/makechrootpkg b/makechrootpkg
index 06e3e74ab98d52ef57fa8eccf1acaf928b33628a..69f9cff3b0e79c9221695b06e6009d050de866ae 100755
--- a/makechrootpkg
+++ b/makechrootpkg
@@ -231,7 +231,7 @@ if mkarchroot -r "/chrootbuild" "$uniondir"; then
         popd >/dev/null
     fi
 
-    local pkgfile=${chrootdir}/union/pkgdest/${pkgname}-${pkgver}-${pkgrel}-*.pkg.tar.gz
+    pkgfile=${chrootdir}/union/pkgdest/${pkgname}-${pkgver}-${pkgrel}-*.pkg.tar.gz
     if [ -e "$pkgfile" ]; then
         if [ -n "$PKGDEST" ]; then
             echo "Moving completed package file to ${PKGDEST}"