FS#47949 - [pacman] Suggested pacman -F UI changes

Attached to Project: Pacman
Opened by Earnestly (Earnest) - Saturday, 30 January 2016, 02:10 GMT
Last edited by Allan McRae (Allan) - Tuesday, 05 November 2019, 05:03 GMT
Task Type Feature Request
Category General
Status Closed
Assigned To Allan McRae (Allan)
Architecture All
Severity Low
Priority Normal
Reported Version 5.0.0
Due in Version 6.0.0
Due Date Undecided
Percent Complete 100%
Votes 4
Private No

Details

These are my opinionated changes to the semantics of pacman -F to more closely
follow pkgfile allowing additional operations to be removed.

I present only three changes and demonstrate the ideal output from pacman -F
with a pkgfile example as a reference. The use of -q, -l or -y is unchanged.


1) pacman -F should mimic pkgfile with no arguments specified

% pkgfile /usr/share/vim/vimfiles/syntax/PKGBUILD.vim
core/pacman

% pkgfile PKGBUILD.vim
core/pacman

% pacman -F /usr/share/vim/vimfiles/syntax/PKGBUILD.vim
core/pacman 4.2.1-4
usr/share/vim/vimfiles/syntax/PKGBUILD.vim

% pacman -F PKGBUILD.vim
core/pacman 4.2.1-4
usr/share/vim/vimfiles/syntax/PKGBUILD.vim


2) pacman -Fo shouldn't need to exist

As demonstrated with pkgfile one can supply a path and get the owner without
needing a separate option to search for paths.

% pacman -F /usr/share/vim/vimfiles/syntax/PKGBUILD.vim
core/pacman 4.2.1-4
usr/share/vim/vimfiles/syntax/PKGBUILD.vim


3) pacman -Fs should mimic pkgfile -r and -x shouldn't exist

% pkgfile -r 'PKG.*BUILD\.vim'
core/pacman

% pacman -Fs 'PKG.*BUILD\.vim'
core/pacman 4.2.1-4
usr/share/vim/vimfiles/syntax/PKGBUILD.vim
This task depends upon

Closed by  Allan McRae (Allan)
Tuesday, 05 November 2019, 05:03 GMT
Reason for closing:  Fixed
Additional comments about closing:  Implemented in pacman-5.2. Any further suggestions should get a fresh bug report.
Comment by Earnestly (Earnest) - Wednesday, 03 February 2016, 17:41 GMT
Some additional suggestions:

When running pacman -Fy there is no indication given to what kind of database is being downloaded and looks identical to pacman -Sy. Would it make sense to change the message pacman prints to indicate that it's downloading file lists and not package databases?

Right now it can cause confusion especially given Arch Linux's policy to not support partial upgrades where pacman -Sy with -u is considered poor form.

Either this or combine pacman -Syu and pacman -Fy to download both at the same time keeping both the package databases and file lists synchronised.
Comment by Earnestly (Earnest) - Wednesday, 03 February 2016, 19:59 GMT
Additional issues:

pacman -Fs non-existent doesn't return a non-zero exit value while pkgfile does.

% pacman -Fs non-existent
%

% pkgfile -s non-existent
zsh: exit 1 pkgfile -s non-existent
%
Comment by Andrew Gregory (andrewgregory) - Friday, 05 February 2016, 13:36 GMT
-Sy and -Fy will not be combined; there would be no point in doing that. The databases downloaded by -Fy *are* package databases; other front-ends can even be configured to use them exclusively instead of the databases downloaded by -Sy. The whole point of providing separate databases is so that people do not have to constantly download the significantly larger .files database in order to perform basic package operations.
Comment by Earnestly (Earnest) - Sunday, 07 February 2016, 15:12 GMT
I realised that your tools create redundant .files databases after the fact, I assumed they did something a little more simple like vodik's repose which only really includes the %FILES% section.

However this is mostly besides the point and was only a tangential thought.
Comment by Allan McRae (Allan) - Friday, 12 February 2016, 14:26 GMT
  • Field changed: Category (Packages: Testing → General)
  • Field changed: Reported Version ( → 5.0.0)
  • Field changed: Due in Version (Undecided → 5.1.0)
  • Field changed: Architecture (All → All)
Scheduling improvements for 5.1.0 - does not guarantee implementation exactly as specified here...
Comment by Eli Schwartz (eschwartz) - Thursday, 07 February 2019, 01:36 GMT Comment by Eli Schwartz (eschwartz) - Wednesday, 14 August 2019, 05:22 GMT Comment by Earnestly (Earnest) - Wednesday, 14 August 2019, 10:51 GMT
A nice negative code commit is always good to see.

Now -F, like -Q, and -S, and -T, and -R, takes an exact input which is also good.

But why was -Fs removed? That provided symmetry with query-like operations such as -Qs and -Ss, both of which support regex. The decision to retain -x instead of repurposing -s seems like an unnecessary break in convention.

A major problem that still remains is that passing a file which doesn't exist in the files databases still doesn't return non-zero. Is this by design such that an empty return is used to indicate non-match while exit statuses are employed for more serious errors/exceptions?

Loading...