[pacman-dev] [PATCH 2/2] makepkg: properly localize some internal function variables

Eli Schwartz eschwartz at archlinux.org
Mon Oct 12 02:22:05 UTC 2020


We leaked fullver and pkgarch all over the place, and only conditionally
unset the other variables. Marking them local is a more proactive
solution.

Signed-off-by: Eli Schwartz <eschwartz at archlinux.org>
---
 scripts/makepkg.sh.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index a9e7c691..89da3fab 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -869,6 +869,7 @@ install_package() {
 }
 
 check_build_status() {
+	local fullver pkgarch allpkgbuilt somepkgbuilt
 	if (( ! SPLITPKG )); then
 		fullver=$(get_full_version)
 		pkgarch=$(get_pkg_arch)
@@ -911,7 +912,6 @@ check_build_status() {
 				exit $E_ALREADY_BUILT
 			fi
 		fi
-		unset allpkgbuilt somepkgbuilt
 	fi
 }
 
-- 
2.28.0


More information about the pacman-dev mailing list