Pacman

Historical bug tracker for the Pacman package manager.

The pacman bug tracker has moved to gitlab:
https://gitlab.archlinux.org/pacman/pacman/-/issues

This tracker remains open for interaction with historical bugs during the transition period. Any new bugs reports will be closed without further action.
Tasklist

FS#36791 - [pacman] downloads to wrong filename with redirect

Attached to Project: Pacman
Opened by Christian Hesse (eworm) - Wednesday, 04 September 2013, 13:17 GMT
Last edited by Allan McRae (Allan) - Monday, 14 October 2013, 05:29 GMT
Task Type Bug Report
Category General
Status Closed
Assigned To Dave Reisner (falconindy)
Architecture All
Severity Medium
Priority Normal
Reported Version 4.1.2
Due in Version 4.2.0
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Summary and Info:
I have my own repository set up this way:

[eworm]
Server = http://mirror.mylinuxtime.de/arch/$repo/$arch/

pacman tries to download http://mirror.mylinuxtime.de/arch/eworm/x86_64/eworm.db and is redirected to http://tdf.lugor.de/arch/eworm/x86_64/eworm.db.tar.gz. It then saves the file to /var/lib/pacman/sync/eworm.db.tar.gz as it derives the name from last URL (or content display name, not sure).
After that pacman tries to access /var/lib/pacman/sync/eworm.db and fails.

Steps to Reproduce:
* Use a mirror that redirects to ${repo}.db.tar.gz
* update sync database
* try to install anything
This task depends upon

Closed by  Allan McRae (Allan)
Monday, 14 October 2013, 05:29 GMT
Reason for closing:  Fixed
Additional comments about closing:  git commit 3b3152fc
Comment by Christian Hesse (eworm) - Wednesday, 04 September 2013, 13:47 GMT
BTW, this is with mirrorbrain which looks up symlinks before redirecting to a mirror.
Comment by Dave Reisner (falconindy) - Wednesday, 04 September 2013, 14:00 GMT
DB names should be golden. I guess the simplest solution would be to add a field to the payload struct that tells curl_download_internal not to allow renames. Probably a fairly simple patch.
Comment by Christian Hesse (eworm) - Wednesday, 04 September 2013, 14:48 GMT
Something like this?

The big block is not really changed except it moves to an else block, so indenting is needed. ;)
Comment by Dave Reisner (falconindy) - Wednesday, 04 September 2013, 14:54 GMT
Pretty much. It'd be nice if it were possible to move the renaming logic to a separate function, but the downloader has a lot of other problems, too.

Please fix the whitespace errors and send to pacman-dev@.
Comment by Christian Hesse (eworm) - Wednesday, 04 September 2013, 15:28 GMT
Done.

Though I wonder nothing drops into my inbox... Do I have to post with a subscribed address?
Comment by Dave Reisner (falconindy) - Wednesday, 04 September 2013, 15:31 GMT
Of course.
Comment by Christian Hesse (eworm) - Wednesday, 04 September 2013, 15:37 GMT
Done.

(/me should remember which mailing lists are subscriber only... Sorry for the noise.)

Loading...