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#9096 - CacheDir regression from 3.0

Attached to Project: Pacman
Opened by Jens Adam (byte) - Friday, 04 January 2008, 22:16 GMT
Last edited by Xavier (shining) - Sunday, 06 January 2008, 11:10 GMT
Task Type Bug Report
Category Backend/Core
Status Closed
Assigned To Dan McGee (toofishes)
Architecture All
Severity Low
Priority Normal
Reported Version git
Due in Version 3.1.0
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

I recently discovered the joy of setting CacheDir to my external hdd mountpoint. That's eliminating quite a lot of duplicate downloads I had been doing before.

With 3.0 it would simply create its own CacheDir when it doesn't exist (hd not mounted), which was okay for me.

With the current -git, it would exit. Maybe it's okay, though I prefer the old behaviour.

But the real reason to whip up this bug, is that it even fails because of the non-existing cachedir, when I want to install a local package with -U.
Is there some logic to this which I'm missing?
This task depends upon

Closed by  Xavier (shining)
Sunday, 06 January 2008, 11:10 GMT
Reason for closing:  Fixed
Additional comments about closing:  fixed in git.
Comment by Xavier (shining) - Saturday, 05 January 2008, 10:54 GMT
Well, it's just that the config and argument parsing is always the same, so the cachedir option is always checked the same way, no matter which operation is run.

But I agree the current behavior is a bit strange:
if a specified cachedir doesn't exist, pacman just fail
if no cachedir are specified, pacman will try to add the default one, /var/cache/pacman/pkg . But if this directory doesn't exist, the alpm_option_add_cachedir won't add it, and pacman will go on anyway, with an empty cachedir list (however, when the cachedir is actually needed, libalpm can fallback on /tmp)

And when the cachedir is actually needed (_alpm_filecache_setup function), it'll attempt to create the cachedir directories it they don't exist.
But this code is not reachable, since only existing directories can be added to the cachedir list using the alpm_option_add_cachedir function.

So either the directory creation in _alpm_filecache_setup could be removed, because it isn't used. Or the directory check in alpm_option_add_cachedir could be removed, because the directory can be created later by _alpm_filecache_setup.
Comment by Dan McGee (toofishes) - Saturday, 05 January 2008, 23:24 GMT
How about this?
Comment by Xavier (shining) - Saturday, 05 January 2008, 23:41 GMT
Yes, this apparently works, and reproduces the old 3.0 behavior as was requested.
Comment by Dan McGee (toofishes) - Sunday, 06 January 2008, 00:00 GMT
Please test with the newest pacman-git build (pacman-git 20080105-1). It should be fixed.
Comment by Jens Adam (byte) - Sunday, 06 January 2008, 11:08 GMT
Yes, this looks okay to me now. Feel free to close.

Loading...