1 | #!/usr/bin/env bash |
2 | # |
3 | # Snippet from deboostrap. |
4 | |
5 | set -e |
6 | |
7 | download_debs() { |
8 | echo download_debs |
9 | } |
10 | |
11 | MIRRORS='a b' |
12 | |
13 | f() { |
14 | for m in $MIRRORS; do |
15 | echo "m $m" |
16 | local pkgdest="foo" |
17 | if [ ! -e "$pkgdest" ]; then continue; fi |
18 | pkgs_to_get="$(download_debs "$m" "$pkgdest" $pkgs_to_get 5>&1 1>&6)" |
19 | if [ -z "$pkgs_to_get" ]; then break; fi |
20 | done 6>&1 |
21 | echo done |
22 | } |
23 | |
24 | f |