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>
This commit is contained in:
Andres P 2010-06-22 22:12:50 -04:30 committed by Allan McRae
parent 2222e9f8df
commit 226c137245
1 changed files with 2 additions and 2 deletions

View File

@ -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#*= }"