FS#66182 - [pacman] CacheDir handling inconsistent
Attached to Project:
Pacman
Opened by Toolybird (Toolybird) - Thursday, 09 April 2020, 07:20 GMT
Last edited by Allan McRae (Allan) - Friday, 23 December 2022, 13:24 GMT
Opened by Toolybird (Toolybird) - Thursday, 09 April 2020, 07:20 GMT
Last edited by Allan McRae (Allan) - Friday, 23 December 2022, 13:24 GMT
|
Details
Description:
Consider the following with a default /etc/pacman.conf: $ pwd /tmp/p $ grep Cache /etc/pacman.conf #CacheDir = /var/cache/pacman/pkg/ $ pacman -v 2>&1 | grep Cache Cache Dirs: /var/cache/pacman/pkg/ $ pacman -v --cachedir=$(pwd) 2>&1 | grep Cache Cache Dirs: /tmp/p/ So far so good. This is what I would expect and matches what the manpage says for --cachedir i.e. "Specify an alternative package cache location" Now, edit /etc/pacman.conf and uncomment the CacheDir directive: $ pwd /tmp/p $ grep Cache /etc/pacman.conf CacheDir = /var/cache/pacman/pkg/ $ pacman -v 2>&1 | grep Cache Cache Dirs: /var/cache/pacman/pkg/ $ pacman -v --cachedir=$(pwd) 2>&1 | grep Cache Cache Dirs: /tmp/p/ /var/cache/pacman/pkg/ We now have multiple CacheDirs which means there is no way to override or bypass the default pacman cache when /etc/pacman.conf contains CacheDir directive(s). (yes, this is a fairly niche scenario, but it breaks at least supermin. I'm trying to understand if this a real pacman bug or whether supermin's pacman support needs fixing). Thanks for looking at this. |
This task depends upon
Closed by Allan McRae (Allan)
Friday, 23 December 2022, 13:24 GMT
Reason for closing: Not a bug
Additional comments about closing: Working as expected.
Friday, 23 December 2022, 13:24 GMT
Reason for closing: Not a bug
Additional comments about closing: Working as expected.
For example, when supermin prepares to assemble an appliance it basically does this:
cd '/var/tmp/superminc9d49d.tmpdir/s1gefh7n'
mkdir -p var/lib/pacman
/usr/bin/fakeroot /usr/bin/pacman -Syw --noconfirm --cachedir=$(pwd) --root=$(pwd) 'bash' 'filesystem' 'glibc' 'iana-etc' 'readline'
for f in '/var/tmp/superminc9d49d.tmpdir/s1gefh7n'/*.pkg.tar.xz; do tar -xf "$f" -C '/var/tmp/superminc9d49d.tmpdir/prepare.d'; done
It's downloading the pkgs into the tmpdir so it can unpack them and do processing. This is the part that fails, because pacman is honoring the cache and not downloading the pkgs.
Like I said, supermin's assumption about how --cachedir= works might be the real problem. Is there another way to force pacman to download pkgs?
Upstream bug report:
https://bugzilla.redhat.com/show_bug.cgi?id=1683798
Feel free to close this one. Thanks for your help.
It likely doesn't cover all scenarios but hey, it works for me. Please comment if I've missed anything obvious.