diff options
author | Loïc Minier <lool@dooz.org> | 2010-01-30 23:09:20 +0100 |
---|---|---|
committer | Loïc Minier <lool@dooz.org> | 2010-01-30 23:09:20 +0100 |
commit | ac899f17f5bef28ce2796750c71c20b3b4557d79 (patch) | |
tree | f5f59c55730ad4cc9fcc563e4fc8b77c177f3301 | |
parent | a41cd69cb2c2eb82653cdb510ec261e8db878c81 (diff) | |
download | pbuilder-ac899f17f5bef28ce2796750c71c20b3b4557d79.tar pbuilder-ac899f17f5bef28ce2796750c71c20b3b4557d79.tar.gz |
Don't use sed to parse mirror-map
-rwxr-xr-x | pbuilder-apt-config | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/pbuilder-apt-config b/pbuilder-apt-config index bbfe3d9..b17a554 100755 --- a/pbuilder-apt-config +++ b/pbuilder-apt-config @@ -66,11 +66,19 @@ get_archive_url() { fi if [ -n "$mirror_map" ]; then - url="$(sed -n "s/^[[:space:]]*//; s/[[:space:]]*\$//; /^#/ d; /^\$/ d; s#^$archive\\([[:space:]]\+\\|\$\\)##p" "$mirror_map")" - if [ -n "$url" ]; then - echo "$url" - return - fi + while read a url; do + case "$a" in + "$archive") + if [ -n "$url" ]; then + echo "$url" + return + fi + ;; + \#*|""|*) + : + ;; + esac + done <"$mirror_map" fi builtin_mirror_map "$archive" } |