1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-11-14 21:35:02 -05:00

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

View File

@ -184,9 +184,9 @@ fi
timesarray=() timesarray=()
for line in "${linearray[@]}"; do for line in "${linearray[@]}"; do
if [[ $line =~ ^# ]]; then if [[ $line =~ ^[[:space:]]*# ]]; then
[[ $TIMESONLY ]] || echo $line [[ $TIMESONLY ]] || echo $line
elif [[ $line =~ ^Server ]]; then elif [[ $line =~ ^[[:space:]]*Server ]]; then
# Getting values and times and such # Getting values and times and such
server="${line#*= }" server="${line#*= }"