Skip to content
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

Fixed Alpine Linux installed package detection #1450

Merged
merged 1 commit into from May 14, 2024

Conversation

hmrodrigues
Copy link
Contributor

apk search lists all packages that have ${package} on the name and that aren't installed

Example for rsh (not installed)

$ apk search rsh 2> /dev/null | grep rsh
abseil-cpp-flags-marshalling-20230802.1-r0
harsh-0.8.30-r0
powershell-7.3.9-r0
starship-1.16.0-r0
starship-bash-completion-1.16.0-r0
starship-fish-completion-1.16.0-r0
starship-zsh-completion-1.16.0-r0
starship-zsh-plugin-1.16.0-r0
$
$ apk list --installed rsh 2> /dev/null | grep rsh
$

Example for busybox (installed)

$ apk search busybox 2> /dev/null | grep busybox
busybox-1.36.1-r15
busybox-binsh-1.36.1-r15
busybox-doc-1.36.1-r15
busybox-extras-1.36.1-r15
busybox-extras-openrc-1.36.1-r15
busybox-ifupdown-1.36.1-r15
busybox-mdev-openrc-1.36.1-r15
busybox-openrc-1.36.1-r15
busybox-static-1.36.1-r15
busybox-suid-1.36.1-r15
$
$ apk list --installed busybox 2> /dev/null | grep busybox
busybox-1.36.1-r15 x86_64 {busybox} (GPL-2.0-only) [installed]
$

grep is still needed since apk list always returns 0

@mboelen
Copy link
Member

mboelen commented May 14, 2024

Thanks, merged!

Output looks indeed better with your change. Sorry it took so long to merge.

@hmrodrigues hmrodrigues deleted the fix/apk-PackageIsInstalled branch May 20, 2024 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants