manjaro / pacman-mirrors

This repo has been archived. Our code is now hosted at
https://gitlab.manjaro.org
GNU General Public License v3.0
25 stars 16 forks source link

issues with custom mirrorlist #130

Closed oberon-manjaro closed 6 years ago

oberon-manjaro commented 6 years ago

I just ran sudo pacman-mirrors -ic Germany and selected the three top listed mirrors.

3selected

Feedback:

.: INFO User generated mirror list
--------------------------
.: INFO Custom mirror file saved: /var/lib/pacman-mirrors/custom-mirrors.json
.: INFO Writing mirror list
   Germany         : http://mirror.philpot.de/manjaro/unstable/$repo/$arch
   Germany         : http://mirror.philpot.de/manjaro/unstable/$repo/$archunstable/$repo/$arch
.: INFO Mirror list generated and saved to: /etc/pacman.d/mirrorlist

As you can see the http philpot mirror is listed twice, once with a link containing /$archunstable/, which doesn't seem right. The https link is missing, so is the third mirror. This is also what /etc/pacman.d/mirrorlist actually contains. Content of /var/lib/pacman-mirrors/custom-mirrors.json:

[
    {
        "country": "Germany",
        "protocols": [
            "https",
            "http"
        ],
        "url": "http://mirror.philpot.de/manjaro/"
    },
    {
        "country": "Germany",
        "protocols": [
            "https",
            "http"
        ],
        "url": "http://mirror.philpot.de/manjaro/"
    },
    {
        "country": "Germany",
        "protocols": [
            "https"
        ],
        "url": "https://repo.rhindon.net/manjaro/"
    }
]

So, the third mirror is listed here, but again philpot http twice, and not the https version. Another time I had selected two mirrors, ragenet and netzspielplatz and only netzspielplatz got listed. Somehow I cannot reproduce this now, but something seems to not work properly here ...

fhdk commented 6 years ago

That is indeed weird

fhdk commented 6 years ago

@oberon2007 That was a nasty one. It has never been in my scenarios that a user would select multiple protocols on the same mirror.

Though it should have - a coder mantra is

"Think like a user" - "A user will double click a button" - "Disable on first click"

But I nailed it - at least I think so.

fhdk commented 6 years ago

Thank you for spotting this.

The condition was indeed not handled properly.

fhdk commented 6 years ago

https://github.com/manjaro/pacman-mirrors/releases/tag/4.9.1