[pacman-dev] [PATCH] Replace an ugly while [ with a for (( loop (makepkg)

Isaac Good pacman at isaac.otherinbox.com
Tue Nov 17 14:18:46 EST 2009


>From b4c17ea05ec861da20a54bc4f7490b4c28dceb37 Mon Sep 17 00:00:00 2001
From: Isaac Good <pacman at isaac.otherinbox.com>
Date: Tue, 17 Nov 2009 14:16:48 -0500
Subject: [PATCH] Replace an ugly while [ with a for (( loop

Signed-off-by: Isaac Good <pacman at isaac.otherinbox.com>
---
 scripts/makepkg.sh.in |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 3d776f0..1d9d8f1 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -514,11 +514,10 @@ generate_checksums() {
 		local numsrc=${#source[@]}
 		echo -n "${integ}sums=("
 
-		local i=0;
+		local i
 		local indent=''
-		while [ $i -lt $((${#integ}+6)) ]; do
+		for (( i = 0; i < ${#integ} + 6; i++ )); do
 			indent="$indent "
-			i=$(($i+1))
 		done
 
 		local netfile
-- 
1.6.5.2



More information about the pacman-dev mailing list