mediocregopher / chroagh

Yet another fork of chroagh which will work for a few months then die
BSD 3-Clause "New" or "Revised" License
13 stars 1 forks source link

Temporarily deal with slow sudo problem #3

Closed eyqs closed 6 years ago

eyqs commented 6 years ago

This commit temporarily addresses the slow sudo problem.

mediocregopher commented 6 years ago

I did some digging on the mirror issue: the x86_64 pacman-mirrorlist package has no mirrors uncommented to start with, while the arm versions have one uncommented at the top:

## Geo-IP based mirror selection and load balancing                                                                                                                                
Server = http://mirror.archlinuxarm.org/$arch/$repo

I don't know what the reason for this would be, but in any case I think the fix you have here would produce some weird results for arm, as it would leave the file with two server lines.

I think the best way would be to just copy some code from the prepare script which backs up the original mirrorlist and overwrites to the new one if $MIRROR is set:

    if [ -n "$MIRROR" -a "$MIRROR" != 'unspecified' ]; then                              
        if [ ! -e /etc/pacman.d/mirrorlist.pacorig ]; then                               
            cp -T /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.pacorig              
        fi                                                                               

        echo "Server = $MIRROR" > /etc/pacman.d/mirrorlist                               
    fi
eyqs commented 6 years ago

Thanks for digging into it! Would you actually like to open a new pull request for that? That way, this commit can be easily reverted when the systemd issue is fixed.

mediocregopher commented 6 years ago

Yup that sounds like a good plan :)