aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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"
}