]> git.saurik.com Git - cydia.git/commitdiff
Indent parsing from sysroot.sh.
authorJay Freeman (saurik) <saurik@saurik.com>
Sat, 12 Mar 2011 23:27:36 +0000 (15:27 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Mon, 14 Mar 2011 12:09:09 +0000 (05:09 -0700)
sysroot.sh

index c32440a45443c965449c4d7de42fe3b646b99d52..607de65a9c6f272e0da9d55192502b81cbc92bc9 100755 (executable)
@@ -62,27 +62,29 @@ function extract() {
 
 declare -A urls
 
-wget -qO- "${repository}dists/${distribution}/${component}/binary-${architecture}/Packages.bz2" | bzcat | {
-    regex='^([^ \t]*): *(.*)'
-    declare -A fields
-
-    while IFS= read -r line; do
-        if [[ ${line} == '' ]]; then
-            package=${fields[package]}
-            if [[ ${package} == *(apr|apr-lib|apt7|apt7-lib|coreutils|mobilesubstrate|pcre) ]]; then
-                filename=${fields[filename]}
-                urls[${package}]=${repository}${filename}
+if [[ 1 ]]; then
+    wget -qO- "${repository}dists/${distribution}/${component}/binary-${architecture}/Packages.bz2" | bzcat | {
+        regex='^([^ \t]*): *(.*)'
+        declare -A fields
+
+        while IFS= read -r line; do
+            if [[ ${line} == '' ]]; then
+                package=${fields[package]}
+                if [[ ${package} == *(apr|apr-lib|apt7|apt7-lib|coreutils|mobilesubstrate|pcre) ]]; then
+                    filename=${fields[filename]}
+                    urls[${package}]=${repository}${filename}
+                fi
+
+                unset fields
+                declare -A fields
+            elif [[ ${line} =~ ${regex} ]]; then
+                name=${BASH_REMATCH[1],,}
+                value=${BASH_REMATCH[2]}
+                fields[${name}]=${value}
             fi
-
-            unset fields
-            declare -A fields
-        elif [[ ${line} =~ ${regex} ]]; then
-            name=${BASH_REMATCH[1],,}
-            value=${BASH_REMATCH[2]}
-            fields[${name}]=${value}
-        fi
-    done
-}
+        done
+    }
+fi
 
 for package in "${!urls[@]}"; do
     extract "${package}" "${urls[${package}]}"