[pacman-dev,4/6] makepkg: Only backup package variables once

Message ID d934e479eadcba6beb5a4b7321f2587e2d108ccb.1529440441.git.jan.steffens@gmail.com
State New
Headers show
Series
  • [pacman-dev,1/6] libmakepkg/util/option: Refactor checking to reduce code duplication
Related show

Commit Message

Jan Alexander Steffens (heftig) June 19, 2018, 8:33 p.m. UTC
We don't need to re-backup the variables we restored on the previous
iteration.
---
 scripts/makepkg.sh.in | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Patch

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 331249ea..bf228202 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1124,11 +1124,10 @@  backup_package_variables() {
 
 run_split_packaging() {
 	local pkgname_backup=("${pkgname[@]}")
-	local restore_package_variables
+	local restore_package_variables="$(backup_package_variables)"
 	for pkgname in ${pkgname_backup[@]}; do
 		pkgdir="$pkgdirbase/$pkgname"
 		mkdir "$pkgdir"
-		restore_package_variables="$(backup_package_variables)"
 		run_package $pkgname
 		tidy_install
 		lint_package || exit $E_PACKAGE_FAILED