FS#54517 - [pacman-contrib] paccache does not use default option on -k

Attached to Project: Arch Linux
Opened by Richard Neumann (rne) - Tuesday, 20 June 2017, 09:14 GMT
Last edited by Dave Reisner (falconindy) - Tuesday, 20 June 2017, 13:43 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:
paccache does not default to "3" on option "-k" as described in "paccache --help".

Additional info:
* pacman 5.0.2-1

Steps to reproduce:
1) Run
$ paccache --help
2) Read '-k, --keep <num> keep "num" of each package in the cache (default: 3).'.
3) Run
$ paccache -ruk
4) Expect behavior of "paccache -ruk 3".
5) Get "paccache: option requires an argument -- 'k'" instead.
This task depends upon

Closed by  Dave Reisner (falconindy)
Tuesday, 20 June 2017, 13:43 GMT
Reason for closing:  Works for me
Additional comments about closing:  working as documented.
Comment by Allan McRae (Allan) - Tuesday, 20 June 2017, 10:39 GMT
  • Field changed: Attached to Project (Pacman → Arch Linux)
  • Field changed: Summary ([pacman] paccache does not use default option on -k → [pacman-contrib] paccache does not use default option on -k)
  • Field changed: Category (Packages: Core → General)
  • Field changed: Reported Version ( → 5.0.1)
  • Field changed: Architecture (All → All)
Changing to pacman-contrib as this script has moved from the pacman codebase. I'm not sure who maintains this now, but it is an Arch project: https://git.archlinux.org/pacman-contrib.git/
Comment by Dave Reisner (falconindy) - Tuesday, 20 June 2017, 12:38 GMT
The default of 3 is when you do not pass -k. If you specify -k in your args, it needs to have a value along with, as the error message says.
Comment by Richard Neumann (rne) - Tuesday, 20 June 2017, 12:42 GMT
Then I misinterpreted the help text.
Still, it seems weird that paccache then obviously keeps stuff even if I do not supply the --keep argument, and thus, if I do not want to keep anything I'd have to tell it to keep stuff with an amount of zero, right?
Comment by Dave Reisner (falconindy) - Tuesday, 20 June 2017, 13:31 GMT
If you accepted all of the defaults (and assuming default keep was 0), then running 'paccache -r' would be no different than 'rm *'. Defaulting to something greater than 0 is a sane and safe default.
Comment by Richard Neumann (rne) - Tuesday, 20 June 2017, 13:38 GMT
I still don't think so, but I agree, that changing the default behaviour would be an unnecessary hassle most likely braking several user's scripts.
Since I now understand how to use paccache for my purpose you may want to close this as "not a bug" as a case of PEBKAC. ;)

Loading...