summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndres P <aepd87@gmail.com>2010-06-22 22:12:50 -0430
committerAllan McRae <allan@archlinux.org>2010-06-23 13:32:21 +1000
commit226c137245192444085d03a7f841b35afe99791c (patch)
tree38c3cebbf1a1f2baacbfd8a80b44695d6f455113
parent2222e9f8dfe6e149262f629571b3432718351d3f (diff)
rankmirrors: fix bogus pacman configuration parsing
Valid pacman configuration files do not have to start with a hash for that line to be a comment, neither do directives need to be in column 0. Signed-off-by: Andres P <aepd87@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
-rw-r--r--scripts/rankmirrors.sh.in4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/rankmirrors.sh.in b/scripts/rankmirrors.sh.in
index 201cc4be..fcb42fa4 100644
--- a/scripts/rankmirrors.sh.in
+++ b/scripts/rankmirrors.sh.in
@@ -184,9 +184,9 @@ fi
timesarray=()
for line in "${linearray[@]}"; do
- if [[ $line =~ ^# ]]; then
+ if [[ $line =~ ^[[:space:]]*# ]]; then
[[ $TIMESONLY ]] || echo $line
- elif [[ $line =~ ^Server ]]; then
+ elif [[ $line =~ ^[[:space:]]*Server ]]; then
# Getting values and times and such
server="${line#*= }"