heyvito / podman-macos

📦 Podman frontend for macOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add MacPorts path

jrjsmrtn opened this issue · comments

podman-macos cannot detect MacPorts' podman, as it's installed in /opt/local/bin.

This patch adds the MacPorts bin path:

diff --git a/Podman/Interop/PMManager.m b/Podman/Interop/PMManager.m
index 97ebd5a..b9f3964 100644
--- a/Podman/Interop/PMManager.m
+++ b/Podman/Interop/PMManager.m
@@ -106,13 +106,16 @@
         }
     }

-    // Test for homebrew default paths as a last resort...
-    NSArray *homebrewDefaultPaths = @[
+    // Test for MacPorts/Homebrew default paths as a last resort...
+    NSArray *packageManagersDefaultPaths = @[
+        // MacPorts
+        @"/opt/local/bin",
+        // Homebrew
         @"/usr/local/bin",
         @"/opt/homebrew/bin",
     ];

-    for (NSString *base in homebrewDefaultPaths) {
+    for (NSString *base in packageManagersDefaultPaths) {
         NSString *target = [base stringByAppendingPathComponent:appName];
         if ([[NSFileManager defaultManager] isExecutableFileAtPath:target]) {
             return target;