FS#67850 - Broken output and file when downloading multiple files with the same name

Attached to Project: Pacman
Opened by Andrew Gregory (andrewgregory) - Tuesday, 08 September 2020, 03:40 GMT
Task Type Bug Report
Category General
Status Unconfirmed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version git
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No

Details

Summary and Info:
Downloading multiple files with the same filename causes nonsensical download output and results in a broken file.

Steps to Reproduce:
sudo ./pacman -U --cachedir /tmp https://archmirror1.octyl.net/core/os/x86_64/linux-5.8.7.arch1-1-x86_64.pkg.tar.zst https://archmirror1.octyl.net/core/os/x86_64/linux-5.8.7.arch1-1-x86_64.pkg.tar.zst https://archmirror1.octyl.net/core/os/x86_64/linux-5.8.7.arch1-1-x86_64.pkg.tar.zst
:: Retrieving packages...
linux-5.8.7.arch1-1-x86_64 26.6 MiB -15.20 MiB/s --:-- [##############--------------------------] 3
linux-5.8.7.arch1-1-x86_64 35.6 MiB -9.69 MiB/s --:-- [###################---------------------] 49
linux-5.8.7.arch1-1-x86_64 32.9 MiB -21.02 MiB/s --:-- [##################----------------------] 4
linux-5.8.7.arch1-1-x86_64 39.6 MiB -2.92 MiB/s --:-- [#####################-------------------] 54
error: could not rename /tmp/linux-5.8.7.arch1-1-x86_64.pkg.tar.zst.part to /tmp/linux-5.8.7.arch1-1-x86_64.pkg.tar.zst (No such file or directory)
error: could not rename /tmp/linux-5.8.7.arch1-1-x86_64.pkg.tar.zst.part to /tmp/linux-5.8.7.arch1-1-x86_64.pkg.tar.zst (No such file or directory)
warning: failed to retrieve some files


md5sum /tmp/linux-5.8.7.arch1-1-x86_64.pkg.tar.zst{,.orig}
5f8537c6685746992a36e92257eb8d2a /tmp/linux-5.8.7.arch1-1-x86_64.pkg.tar.zst
4968f1c7f28edfedd7205448228df00e /tmp/linux-5.8.7.arch1-1-x86_64.pkg.tar.zst.orig
This task depends upon

Comment by Allan McRae (Allan) - Tuesday, 08 September 2020, 05:29 GMT
There are two possibilities that we need to consider:

1) Using -S where we know the final file names from the database. This can be readily addressed by a pre-download check.

2) Using -U where we may or may not know the final filename. That is a lot more difficult.

Loading...