You are not logged in.

#1 2020-04-11 15:50:34

rakoo
Member
Registered: 2013-04-06
Posts: 6

rankmirrors in pacman-contrib doesn't follow URLs

Hi all,

I'm using rankmirrors from pacman-contrib, and I'd like to fix a bug but I don't know what's the proper venue for this.

rankmirror uses the following curl call to know if a mirror is responding:

curl -s -m $MAX_TIME -w "%{time_total} %{http_code}" "$1" -o/dev/null

The result is then parsed with this:

(( ${output[1]} >= 400 || ! ${output[1]} )) && echo unreachable && return

The issue is that some repositories return a 301 Moved Permanently (I'm thinking of http://archlinux.vi-di.fr/core/os/x86_84 for instance, that redirects to https://archlinux.vi-di.fr/core/os/x86_84: the same with https). 301 < 400 so the repo is marked as reachable, unfortunately if you follow the redirect you see that the repo is unreachable (returns a 503)

I propose adding a -L to the curl call to follow the redirect:

curl -L -s -m $MAX_TIME -w "%{time_total} %{http_code}" "$1" -o/dev/null

Is there some pull request I can open somewhere ? What is the correct place for contributing to this ?

Offline

#2 2020-04-12 00:31:34

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,365
Website

Re: rankmirrors in pacman-contrib doesn't follow URLs

Can submit patches here:
https://lists.archlinux.org/listinfo/arch-projects

Or via the bug tracker.   Code available in our git repo.

Offline

#3 2020-04-13 22:03:08

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: rankmirrors in pacman-contrib doesn't follow URLs

Actually pacman-contrib does have a dedicated list at https://lists.archlinux.org/listinfo/pacman-contrib

@rakoo our git repository hosting is at https://git.archlinux.org/

$ pacman -Si pacman-contrib
Repository      : community
Name            : pacman-contrib
Version         : 1.3.0-1
Description     : Contributed scripts and tools for pacman systems
Architecture    : x86_64
URL             : https://git.archlinux.org/pacman-contrib.git/about/
[...]

The file https://git.archlinux.org/pacman-contri … atches.txt describes how to submit patches and where to.

Last edited by eschwartz (2020-04-13 22:05:26)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

Board footer

Powered by FluxBB