aboutsummaryrefslogtreecommitdiff
path: root/pbuilder-apt-config
diff options
context:
space:
mode:
authorLoïc Minier <lool@dooz.org>2010-01-30 23:09:20 +0100
committerLoïc Minier <lool@dooz.org>2010-01-30 23:09:20 +0100
commitac899f17f5bef28ce2796750c71c20b3b4557d79 (patch)
treef5f59c55730ad4cc9fcc563e4fc8b77c177f3301 /pbuilder-apt-config
parenta41cd69cb2c2eb82653cdb510ec261e8db878c81 (diff)
downloadpbuilder-ac899f17f5bef28ce2796750c71c20b3b4557d79.tar
pbuilder-ac899f17f5bef28ce2796750c71c20b3b4557d79.tar.gz
Don't use sed to parse mirror-map
Diffstat (limited to 'pbuilder-apt-config')
-rwxr-xr-xpbuilder-apt-config18
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"
}