[pacman-dev] [PATCH] libalpm: Log URLs when retrying

Morgan Adamiec morganamilo at archlinux.org
Sun Oct 3 23:22:13 UTC 2021



On 03/10/2021 13:42, Vladimir Panteleev wrote:
> On 27/09/2021 20.40, morganamilo at archlinux.org (Morgan Adamiec) wrote:
>> On 09/09/2021 09:41, Vladimir Panteleev via pacman-dev wrote:
>>> Allow finding which mirror was used to fetch a file.
>>>
>>> This makes it a bit easier to debug situations in which mirrors serve
>>> bad files with HTTP 200.
>>>
>>> Signed-off-by: Vladimir Panteleev <archlinux at cy.md>
>>> ---
>>>   lib/libalpm/dload.c | 3 +++
>>>   1 file changed, 3 insertions(+)
>>>
>>> diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c
>>> index 4322318b..022bc7fd 100644
>>> --- a/lib/libalpm/dload.c
>>> +++ b/lib/libalpm/dload.c
>>> @@ -427,6 +427,9 @@ static int curl_retry_next_server(CURLM *curlm,
>>> CURL *curl, struct dload_payload
>>>       len = strlen(server) + strlen(payload->filepath) + 2;
>>>       MALLOC(payload->fileurl, len, RET_ERR(handle, ALPM_ERR_MEMORY,
>>> -1));
>>>       snprintf(payload->fileurl, len, "%s/%s", server,
>>> payload->filepath);
>>> +    _alpm_log(handle, ALPM_LOG_DEBUG,
>>> +            "%s: retrying from %s\n",
>>> +            payload->remote_name, payload->fileurl);
>>>           fflush(payload->localf);
>>>
>>
>> Doesn't pacman already do this though?
> 
> Not when retrying due to e.g. HTTP 404.
> 
> BTW, I missed your message because (AFAICS) I was not CC'd - I think
> "reply to all" makes more sense on a mailing list. (Alternatively
> looking forward to contributions being acceptable via GitLab.)
> 
> Thanks.
> 


Still I seems to work with 404's too

:: Retrieving packages...
 filesystem-2018.1-2-x86_64 downloading...
---
debug: filesystem-2018.1-2-x86_64.pkg.tar.xz: url is
http://mirror.bytemark.co.uk/archlinux/core/os/x86_64/filesystem-2018.1-2-x86_64.pkg.tar.xz
---
debug: filesystem-2018.1-2-x86_64.pkg.tar.xz: maxsize 7972
debug: filesystem-2018.1-2-x86_64.pkg.tar.xz: opened tempfile for
download:
/var/cache/pacman/pkg/filesystem-2018.1-2-x86_64.pkg.tar.xz.part (wb)
debug: filesystem-2018.1-2-x86_64.pkg.tar.xz: curl returned result 0
from transfer
debug: filesystem-2018.1-2-x86_64.pkg.tar.xz: response code 404
error: failed retrieving file 'filesystem-2018.1-2-x86_64.pkg.tar.xz'
from mirror.bytemark.co.uk : The requested URL returned error: 404
debug: filesystem-2018.1-2-x86_64.pkg.tar.xz: tempfile found, attempting
continuation from 0 bytes
debug: filesystem-2018.1-2-x86_64.pkg.tar.xz: curl returned result 0
from transfer
debug: filesystem-2018.1-2-x86_64.pkg.tar.xz: response code 200
---
debug: filesystem-2018.1-2-x86_64.pkg.tar.xz.sig: url is
https://ia601006.us.archive.org/6/items/archlinux_pkg_filesystem/filesystem-2018.1-2-x86_64.pkg.tar.xz.sig
---
debug: filesystem-2018.1-2-x86_64.pkg.tar.xz.sig: maxsize 16384
debug: filesystem-2018.1-2-x86_64.pkg.tar.xz.sig: opened tempfile for
download:
/var/cache/pacman/pkg/filesystem-2018.1-2-x86_64.pkg.tar.xz.sig.part (wb)
debug: filesystem-2018.1-2-x86_64.pkg.tar.xz.sig: curl returned result 0
from transfer
debug: filesystem-2018.1-2-x86_64.pkg.tar.xz.sig: response code 200
debug: curl_download_internal return code is 0
checking keyring...

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <https://lists.archlinux.org/pipermail/pacman-dev/attachments/20211004/55199f09/attachment.sig>


More information about the pacman-dev mailing list