Open radioflash opened 4 months ago
Any feedback on this? This is a fix/improvement that I would personally love to see merged.
It fixes the primary use of pacman -Qo
(i.e. "which package, if any, provides < specific command >?") instead of erroring out in a somewhat confusing manner (See linked issue #36 for details).
Is there anything I could do to get this accepted? I'm fully prepared to take care of the MSYS2-packages pull request if this is accepted!
This does only handle pacman -Qo ntldd and not pacman -Qo /ucrt64/bin/ntldd, right?
Thats correct. Right now the changes should be least-intrusive; I believe I would need either two additional lstats for every queried file, or to retry failed ownership checks (with .exe).
edit: Currently only queries that do PATH lookup anyway are affected
Maybe my performance-concerns are completely misguided here, and I should just make the pacman -Qo /ucrt64/bin/ntldd
check also work? Just tell me and I'll update the PR!
Thanks for the review!
If we check ownership for a file we find in the system PATH then we might need a .exe suffix on the full path we identified, because although MSYS will confirm the files existence even if the suffix is missing, we need the "correct" path for the actual ownership check.
See issue https://github.com/msys2/msys2-pacman/issues/36 for details.
Examples
This used to fail:
Fully specifying the executable name still works:
"Correct" file is checked if there is a wrapper AND an exe file with the same name:
Ownership check fails if an exe extension is erroneously specified (no xzcmp.exe exists):
Performance impact should be negligible; this has no effect if there is any path separator in the query, and the worstcase is basically an additional lstat call.