I’m currently manually parsing pacman’s packages listed in the -Syyu output, manually filtering them for a keyword, and then adding them to the ignore list manually. eg. I grep for cuda
then extract listed packages manually to: --ignore=cuda,cuda-tools,magma-cuda,etc
I could make my owns script to do this but it feels like something pacman should have.
If not pacman, any chance yay or paru support this feature?
I’m not l33t enough to parse if this bash code has wildcards, from pacman source (zsh completions), specifically the % is throwing me off, but it feels like I could just add some ‘*’ to make it work, ie${*words[CURRENT]*%/*}
, is this true?
_pacman_completions_all_packages() {
local -a seq sep cmd packages repositories packages_long
_pacman_get_command
if [[ ${words[CURRENT-1]} == '--ignore' ]]; then
seq='_sequence'
sep=(-S ',')
else
seq=
sep=()
fi
if compset -P1 '*/*'; then
packages=( $(_call_program packages $cmd[@] -Sql ${words[CURRENT]%/*}) )
typeset -U packages
${seq} _wanted repo_packages expl "repository/package" compadd ${sep[@]} ${(@)packages}
else
packages=( $(_call_program packages $cmd[@] -Sql) )
typeset -U packages
${seq} _wanted packages expl "packages" compadd ${sep[@]} - "${(@)packages}"
repositories=($(pacman-conf --repo-list))
typeset -U repositories
_wanted repo_packages expl "repository/package" compadd -S "/" $repositories
fi
}