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

Message ID 20201012022205.1272204-2-eschwartz@archlinux.org
State New
Headers show
Series
  • [pacman-dev,1/2] makepkg: fix signing of source packages
Related show

Commit Message

Eli Schwartz Oct. 12, 2020, 2:22 a.m. UTC
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@archlinux.org>
---
 scripts/makepkg.sh.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Allan McRae Oct. 21, 2020, 1:18 a.m. UTC | #1
On 12/10/20 12:22 pm, Eli Schwartz wrote:
> We leaked fullver and pkgarch all over the place, and only conditionally
> unset the other variables. Marking them local is a more proactive
> solution.
> 

OK.

> Signed-off-by: Eli Schwartz <eschwartz@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
>  }
>  
>

Patch

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
 }