diff options
Diffstat (limited to 'sysroot.sh')
-rwxr-xr-x | sysroot.sh | 42 |
1 files changed, 22 insertions, 20 deletions
@@ -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}]}" |