Pacman

Welcome to the Pacman bug tracker. Please search the current bugs and feature requests before filing a new one! Use advanced search and select "Search in Comments".

* Please select the correct category and version.
* Write a descriptive summary, background info, and provide a reproducible test case whenever possible.
Tasklist

FS#71109 - [pacman] regression in pacman:6 breaks local repo, package caching.

Attached to Project: Pacman
Opened by bartus (bartus) - Wednesday, 02 June 2021, 20:16 GMT
Last edited by Allan McRae (Allan) - Saturday, 04 September 2021, 02:28 GMT
Task Type Bug Report
Category General
Status Unconfirmed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version 6.0.0
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 5
Private No

Details

Description:

Having local repository as `CacheDir` in `pacman.conf` isn't honored by `pacman:6`.

This behaviour is leverage in e.g: `devtools:arch-nspawn` or `AUR/aurutils`.

In `pacman:5` adding local location repository as a `CacheDir` in `pacman.conf` results in packages being fetched form local repo without "downloading" during installation.

In `pacman:6` packages gets "download" to the first `CacheDir` named in `pacman.conf` although they are accessible
through additional `CacheDir`.

Additional info:
* pacman:6.0.0
This task depends upon

Comment by bartus (bartus) - Wednesday, 02 June 2021, 20:43 GMT
`pacman --debug -S tmp/test` shows that cached package file is correctly located but nevertheless it gets "downloaded" instead of fetched from cache.
```
$pacman --debug -S tmp/test
...
Packages (1) test-0.1-1 :: Proceed with installation? [Y/n]
debug: using cachedir: /home/_pacman_cache/pkg/
debug: found cached pkg: /tmp/tmp_repo/test-0.1-1-x86_64.pkg.tar.zst
...
:: Retrieving packages...
test-0.1-1-x86_64 downloading...
debug: test-0.1-1-x86_64.pkg.tar.zst: url is file:///tmp/tmp_repo/test-0.1-1-x86_64.pkg.tar.zst
debug: test-0.1-1-x86_64.pkg.tar.zst: maxsize 33823
debug: test-0.1-1-x86_64.pkg.tar.zst: opened tempfile for download: /home/_pacman_cache/pkg/test-0.1-1-x86_64.pkg.tar.zst.part (wb)
...
```

* local repo location: `/tmp/tmp_repo`
* test package: `curl -s http://ix.io/3oAO > PKGBUILD; makepkg`
* pacman.conf:
```
[options]
CacheDir = /tmp/tmp_repo
CleanMethod = KeepCurrent

[tmp]
SigLevel = Optional TrustAll
Server = file:///tmp/tmp_repo
```
Comment by Eli Schwartz (eschwartz) - Wednesday, 02 June 2021, 21:23 GMT
  • Field changed: Attached to Project (Arch Linux → Pacman)
Assigning to the actual pacman bugtracker...
Comment by Eli Schwartz (eschwartz) - Friday, 04 June 2021, 00:48 GMT
I have duplicated this bug with the "bash" package from the official core package, mv'ed from the primary cachedir to a secondary cachedir.

However in order to reproduce it, it must be a package where the *.pkg.tar.zst is cached, but the *.pkg.tar.zst.sig is *not* cached. This triggers the download code, but it tries to download both the original package and the signature.

For repos where the SigLevel is optional, and there is no .sig file, the missing .sig file will trigger an *attempted* download of both, and even though trying to download the .sig file fails, the trying is enough to cause pacman to redownload the package.

If the package is in one cachedir and the .sig is in another cachedir, pacman is perfectly happy to decide everything is cached, and not bother running the download code.
Comment by bartus (bartus) - Friday, 04 June 2021, 10:14 GMT
A minor addendum: total progress bar gets over 100%, looks like redownloading packages from local repository isn't accounted in total download size.
Also yes, setting `SigLevel = Never` in the repository section alleviates the issue.

Loading...