bedrocklinux / bedrocklinux-userland

This tracks development for the things such as scripts and (defaults for) config files for Bedrock Linux
https://bedrocklinux.org
GNU General Public License v2.0
614 stars 67 forks source link

pmm: pacman,yay: Fix which-packages-provide-file #217

Closed NICHOLAS85 closed 3 years ago

NICHOLAS85 commented 3 years ago

Fixes broken implementation.

Quick question before you merge: pacman, Line 129 and yay, line 135 split($(NF-1), a, \"/\");\ You used $(NF-1) to get the second from the last field. I changed this to $1 as sometimes "[installed]" is included as an extra field, making $(NF-1) unreliable. Heres an example problematic output:

$ pacman -F zsh
extra/zsh 5.8-1 [installed]
    usr/bin/zsh
community/grunt-cli 1.3.2-2
    usr/lib/node_modules/grunt-cli/completion/zsh
...

Before we continue with $1, is there a reason you chose $(NF-1)? Is there sometimes an extra field before the package name?

paradigm commented 3 years ago

Nice