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#57503 - [pacman-contrib] paccache doesn't handle *.pkg.tar.sig files correctly

Attached to Project: Pacman
Opened by Maxim Baz (maximbaz) - Wednesday, 14 February 2018, 09:43 GMT
Last edited by Eli Schwartz (eschwartz) - Monday, 05 March 2018, 06:19 GMT
Task Type Bug Report
Category General
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version 5.0.1
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

I have a custom repo, which besides packages (*.pkg.tar) contains signatures (*.pkg.tar.sig) for every package. When I run `paccache -r`, I expect paccache to keep 3 packages and 3 corresponding signature files, but instead paccache attempts to remove more files. Initially I thought that paccache doesn't know the concept of signatures and simply treats signature files as packages, but it doesn't look as simple. Have a look at this example:

```
$ ls -l /var/cache/pacman/myrepo
...
.rw-r--r-- 901k maximbaz 29 Jan 1:19 universal-ctags-git-0.r5776.ecad395a-1-x86_64.pkg.tar
.rw-r--r-- 566 maximbaz 29 Jan 1:19 universal-ctags-git-0.r5776.ecad395a-1-x86_64.pkg.tar.sig
.rw-r--r-- 901k maximbaz 29 Jan 17:05 universal-ctags-git-0.r5781.17d07a30-1-x86_64.pkg.tar
.rw-r--r-- 566 maximbaz 29 Jan 17:05 universal-ctags-git-0.r5781.17d07a30-1-x86_64.pkg.tar.sig
.rw-r--r-- 901k maximbaz 2 Feb 20:03 universal-ctags-git-0.r5784.27728ac9-1-x86_64.pkg.tar
.rw-r--r-- 566 maximbaz 2 Feb 20:03 universal-ctags-git-0.r5784.27728ac9-1-x86_64.pkg.tar.sig
.rw-r--r-- 901k maximbaz 11 Feb 22:30 universal-ctags-git-0.r5786.7918d19f-1-x86_64.pkg.tar
.rw-r--r-- 566 maximbaz 11 Feb 22:31 universal-ctags-git-0.r5786.7918d19f-1-x86_64.pkg.tar.sig
.rw-r--r-- 901k maximbaz 14 Feb 9:30 universal-ctags-git-0.r5791.40b8e1e3-1-x86_64.pkg.tar
.rw-r--r-- 566 maximbaz 14 Feb 9:30 universal-ctags-git-0.r5791.40b8e1e3-1-x86_64.pkg.tar.sig
.rw-r--r-- 2.4M maximbaz 27 Jan 18:32 yubikey-touch-detector-1.0.2-1-x86_64.pkg.tar
.rw-r--r-- 566 maximbaz 27 Jan 18:32 yubikey-touch-detector-1.0.2-1-x86_64.pkg.tar.sig
.rw-r--r-- 2.4M maximbaz 26 Jan 19:28 yubikey-touch-detector-1.0.3-1-x86_64.pkg.tar
.rw-r--r-- 566 maximbaz 26 Jan 19:28 yubikey-touch-detector-1.0.3-1-x86_64.pkg.tar.sig


$ paccache -vvv -d -c /var/cache/pacman/myrepo
...
universal-ctags-git (x86_64):
universal-ctags-git-0.r5776.ecad395a-1-x86_64.pkg.tar
universal-ctags-git-0.r5776.ecad395a-1-x86_64.pkg.tar.sig
universal-ctags-git-0.r5776.ecad395a-1-x86_64.pkg.tar.sig <-------- duplicate
universal-ctags-git-0.r5781.17d07a30-1-x86_64.pkg.tar
universal-ctags-git-0.r5781.17d07a30-1-x86_64.pkg.tar.sig
universal-ctags-git-0.r5781.17d07a30-1-x86_64.pkg.tar.sig <-------- duplicate
universal-ctags-git-0.r5784.27728ac9-1-x86_64.pkg.tar <~~~~~~~~ should keep
universal-ctags-git-0.r5784.27728ac9-1-x86_64.pkg.tar.sig <~~~~~~~~ should keep
universal-ctags-git-0.r5784.27728ac9-1-x86_64.pkg.tar.sig <-------- duplicate
universal-ctags-git-0.r5786.7918d19f-1-x86_64.pkg.tar <~~~~~~~~ should keep
universal-ctags-git-0.r5786.7918d19f-1-x86_64.pkg.tar.sig <~~~~~~~~ should keep
yubikey-touch-detector (x86_64):
yubikey-touch-detector-1.0.2-1-x86_64.pkg.tar <~~~~~~~~ should keep
yubikey-touch-detector-1.0.2-1-x86_64.pkg.tar.sig <~~~~~~~~ should keep


$ paccache -vvv -d -c /var/cache/pacman/myrepo -k 2
...
universal-ctags-git (x86_64):
universal-ctags-git-0.r5776.ecad395a-1-x86_64.pkg.tar
universal-ctags-git-0.r5776.ecad395a-1-x86_64.pkg.tar.sig
universal-ctags-git-0.r5776.ecad395a-1-x86_64.pkg.tar.sig <-------- duplicate
universal-ctags-git-0.r5781.17d07a30-1-x86_64.pkg.tar
universal-ctags-git-0.r5781.17d07a30-1-x86_64.pkg.tar.sig
universal-ctags-git-0.r5781.17d07a30-1-x86_64.pkg.tar.sig <-------- duplicate
universal-ctags-git-0.r5784.27728ac9-1-x86_64.pkg.tar
universal-ctags-git-0.r5784.27728ac9-1-x86_64.pkg.tar.sig
universal-ctags-git-0.r5784.27728ac9-1-x86_64.pkg.tar.sig <-------- duplicate
universal-ctags-git-0.r5786.7918d19f-1-x86_64.pkg.tar <~~~~~~~~ should keep
universal-ctags-git-0.r5786.7918d19f-1-x86_64.pkg.tar.sig <~~~~~~~~ should keep
universal-ctags-git-0.r5786.7918d19f-1-x86_64.pkg.tar.sig <-------- duplicate
yubikey-touch-detector (x86_64):
yubikey-touch-detector-1.0.2-1-x86_64.pkg.tar <~~~~~~~~ should keep
yubikey-touch-detector-1.0.2-1-x86_64.pkg.tar.sig <~~~~~~~~ should keep
yubikey-touch-detector-1.0.2-1-x86_64.pkg.tar.sig <-------- duplicate
```

If I remove all signature files, paccache starts working as expected... but I need the signature files :)

Additional info:
* package version(s): pacman 5.0.2-2
* config and/or log files etc. `CacheDir = /var/cache/pacman/myrepo`
This task depends upon

Closed by  Eli Schwartz (eschwartz)
Monday, 05 March 2018, 06:19 GMT
Reason for closing:  Fixed
Additional comments about closing:  https://git.archlinux.org/pacman-contrib .git/commit/?id=30d9671be5c3957df4ed96b4 0f8e8bb228fbad11
Comment by Maxim Baz (maximbaz) - Wednesday, 14 February 2018, 11:12 GMT
Please add the [pacman] prefix to the title, I cannot edit the title now and the bug doesn't appear in the "Bug Reports" of "pacman" package.
Comment by Maxim Baz (maximbaz) - Tuesday, 20 February 2018, 10:37 GMT
Naive fix that I confirm works:

--- paccache.orig 2018-02-20 11:36:19.069860998 +0100
+++ paccache 2018-02-20 11:35:53.472013000 +0100
@@ -535,7 +535,7 @@
# note that these results are returned in an arbitrary order from awk, but
# they'll be resorted (in summarize) iff we have a verbosity level set.
IFS=$'\n' read -r -d '' -a cand < \
- <(printf '%s\n' "$PWD"/*.pkg.tar?(.+([^.])) | pacsort --files |
+ <(printf '%s\n' "$PWD"/*.pkg.tar?(.+([^.])) | grep -v '\.sig$' | pacsort --files |
pkgfilter "$keep" "$scanarch" \
"${#whitelist[*]}" "${whitelist[@]}" \
"${#blacklist[*]}" "${blacklist[@]}")
Comment by Eli Schwartz (eschwartz) - Wednesday, 21 February 2018, 16:07 GMT
Consider posting a git-formatted patch to https://lists.archlinux.org/listinfo/pacman-contrib that applies to the source tree at https://git.archlinux.org/pacman-contrib.git/

Loading...