FS#55856 - pacman -Qo fails if the specified file does not exist

Attached to Project: Pacman
Opened by eomanis (eomanis) - Wednesday, 04 October 2017, 00:59 GMT
Last edited by Eli Schwartz (eschwartz) - Tuesday, 15 May 2018, 20:33 GMT
Task Type Bug Report
Category Backend/Core
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version 5.0.1
Due in Version 5.1.0
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

pacman 5.0.2-2

So there was an update that affected /etc/drirc, and while I never laid hands on this particular file, pacman installed its replacement as /etc/drirc.pacnew. (Why it did that may be a story for a different bug report.)

Anyway, I was merging and moving /etc/*.pacnew files for one of my systems, and as I was doing so I made a mistake:
[root@mysystem ~]# rm /etc/drirc.pacnew /etc/drirc
Which was supposed to be
[root@mysystem ~]# mv /etc/drirc.pacnew /etc/drirc

Well no problem, one can always find out, for installed packages, which package a file belongs to, and reinstall that package. Or so I thought:
[root@mysystem ~]# pacman -Qo /etc/drirc
error: failed to read file '/etc/drirc': No such file or directory

Well that was decidedly less helpful than how it could have been.

Now, Arch is so awesome that it has replaced almost all other operating systems in my home, so using any other of the available Arch systems to figure out that /etc/drirc belongs to the package "mesa" was a piece of cake.
Still, I suppose that pacman could be improved in that regard, just in case if somebody does not have a second running Arch system at their disposal. I suspect that pacman tries to find a file's absolute path, and if the file does not exist, it fails hard.
If the absolute path of a file or directory given for pacman -Qo cannot be determined, it should at least fail gracefully and proceed with its look-up with the path as it is given.
This task depends upon

Closed by  Eli Schwartz (eschwartz)
Tuesday, 15 May 2018, 20:33 GMT
Reason for closing:  Fixed
Additional comments about closing:  https://git.archlinux.org/pacman.git/com mit/?id=a100cd6bca5b56ef4a8f3ec15ef39efe 9d23f1f8

Loading...