Skip to content

Ensure rpm --whatprovides is deduplicated #336

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions tasks/linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,9 @@ case "$available_manager" in

# yum install <pkg> and rpm -q <pkg> may produce different results because one package may provide another
# For example, 'vim' can be installed because the 'vim-enhanced' package provides 'vim'
# So, find out the exact package to get the status for
provided_package="$(rpm -q --whatprovides "$name")" || provided_package=
# So, find out the exact package to get the status for. Ensure the results are de-duplicated
# for packages which may match the whatprovides query more than once.
provided_package="$(rpm -q --whatprovides "$name" | sort -u)" || provided_package=

# <package>-<version> is the syntax for installing a specific version in yum
[[ $version ]] && full_name="${name}-${version}" || full_name="${name}"
Expand Down