[pacman-dev] [PATCH] Add config var to limit repo connection timeout

Maarten de Vries maarten at de-vri.es
Sun Apr 7 20:19:09 UTC 2019


On Sun, 7 Apr 2019 at 21:02, Andrew Gregory <andrew.gregory.8 at gmail.com> wrote:
>
> On 04/06/19 at 04:43pm, Nathan Aclander wrote:
> > Using this patch seemed more usable for me than to having to comment out
> > mirrors manually depending my network conditions. Are you concerned that
> > having this parameter be tunable would cause pacman.conf to be too
> > complex?
>
> More or less, yes.  We don't want to have to implement every single option that
> libcurl provides in pacman, so we try to require a fairly compelling
> justification before adding them.  We are not against making network operations
> more configurable, though.  In fact, we would like to get rid of the external
> downloader, but can't because some people need specific settings that we don't,
> and never will, expose directly.  So, if you, or anybody else, can come up with
> a more general solution that doesn't require us to add dozens of options to
> pacman.conf, we'd love to hear it.

I ran into the same objections when I wanted to expose a curl option
(in my case for client certificate authentication). But maintaining a
patched pacman seemed like too much long-term work, so instead I made
curl-inject-opt [1], a program using LD_PRELOAD to inject curl options
into sessions of another program. I also added it to the AUR [2].

It's not nearly as user friendly as a native pacman configuration
option would be though:
$ sudo curl-inject-opt --connect-timeout 1000 pacman -Syu

You could put that in a wrapper script of course. You can even call
the wrapper `pacman` and put it somewhere in your PATH (if you specify
the real pacman by absolute path).

It also currently doesn't come close to supporting all CURL options,
but the goal is to support all sensible CURL options. So if you need
one that's missing, issues or pull requests are welcome. I just added
--timeout and --connect-timeout :-)

[1] https://github.com/de-vri-es/curl-inject-opt
[2] https://aur.archlinux.org/packages/curl-inject-opt


More information about the pacman-dev mailing list