Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions src/UniGetUI.PackageEngine.Managers.Apt/Apt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ public Apt()

public override IReadOnlyList<string> FindCandidateExecutableFiles()
{
var candidates = new List<string>(CoreTools.WhichMultiple("apt"));
foreach (var path in new[] { "/usr/bin/apt", "/usr/local/bin/apt" })
var candidates = new List<string>();
foreach (var path in new[] { "/usr/bin/apt", "/bin/apt" })
{
if (File.Exists(path) && !candidates.Contains(path))
candidates.Add(path);
Comment on lines +55 to 59
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

Candidate discovery only checks File.Exists; it will treat non-executable files (missing +x) as valid candidates and may mark the manager as found, then later fail to launch with a permission error. Consider additionally verifying executability (e.g., via Unix execute bits) or reusing CoreTools.WhichMultiple/Which on the absolute paths to leverage its executable-checking logic without searching PATH.

Copilot uses AI. Check for mistakes.
Expand Down
9 changes: 2 additions & 7 deletions src/UniGetUI.PackageEngine.Managers.Dnf/Dnf.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,8 @@ public Dnf()

public override IReadOnlyList<string> FindCandidateExecutableFiles()
{
var candidates = new List<string>(CoreTools.WhichMultiple("dnf5"));
foreach (var path in CoreTools.WhichMultiple("dnf"))
{
if (!candidates.Contains(path))
candidates.Add(path);
}
foreach (var path in new[] { "/usr/bin/dnf5", "/usr/bin/dnf", "/usr/local/bin/dnf" })
var candidates = new List<string>();
foreach (var path in new[] { "/usr/bin/dnf5", "/usr/bin/dnf", "/bin/dnf5", "/bin/dnf" })
{
if (File.Exists(path) && !candidates.Contains(path))
candidates.Add(path);
Expand Down
4 changes: 2 additions & 2 deletions src/UniGetUI.PackageEngine.Managers.Pacman/Pacman.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ public Pacman()

public override IReadOnlyList<string> FindCandidateExecutableFiles()
{
var candidates = new List<string>(CoreTools.WhichMultiple("pacman"));
foreach (var path in new[] { "/usr/bin/pacman", "/usr/local/bin/pacman" })
var candidates = new List<string>();
foreach (var path in new[] { "/usr/bin/pacman", "/bin/pacman" })
{
if (File.Exists(path) && !candidates.Contains(path))
candidates.Add(path);
Comment on lines +54 to 58
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

FindCandidateExecutableFiles currently accepts any existing file at these locations, even if it isn’t executable (no +x). Consider checking Unix execute permissions (or using CoreTools.WhichMultiple/Which with absolute paths) so the manager isn’t marked found when the binary can’t be launched.

Copilot uses AI. Check for mistakes.
Expand Down
Loading