From 226c137245192444085d03a7f841b35afe99791c Mon Sep 17 00:00:00 2001 From: Andres P Date: Tue, 22 Jun 2010 22:12:50 -0430 Subject: 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 Signed-off-by: Allan McRae --- scripts/rankmirrors.sh.in | 4 ++-- 1 file 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#*= }" -- cgit v1.2.3-70-g09d2