Skip to content
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
2 changes: 1 addition & 1 deletion Sources/LinuxPlatform/Linux.swift
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ public struct Linux: Platform {
}
return false
case "yum":
let result = try await run(.name("yum"), arguments: ["list", "installed", package], output: .discarded)
let result = try await run(.name("yum"), arguments: ["list", "--installed", package], output: .string(limit: 100 * 1024))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, this may not be working with Amazon Linux 2, which doesn't have dnf options like --installed.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would your preferred solution for this look like? I guess it would be simplest to check the output of the command for a correctly installed package (similar to what is done for the apt-get version).
Alternatively, dnf could be called with yum as a fallback?

return result.terminationStatus.isSuccess
default:
return true
Expand Down