diff options
author | Jamie Couture <jamie.couture@gmail.com> | 2014-09-09 21:39:01 -0400 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2014-09-21 19:52:36 +0200 |
commit | 0916d4f1f7d35bb7420054fd148be500a678ea91 (patch) | |
tree | cdbb2afcc584f8a62ff0bb0e24c85fb205b98c02 /src | |
parent | 71a1618e6e49c22bb78ec8e7b164a41df5440a77 (diff) |
platform: find getopt in alternate osx locations
Some users may use MacPorts instead of Homebrew. If brew fails to
return a prefix for getopt, check if the user has 'port' installed and
use the MacPort ${prefix} /opt/local.
Avoids an issue where pass terminates because getopt cannot be resolved
in the assumed location /usr/local/bin. Provide support to resolve
absolute path of getopt from a MacPorts installation.
Signed-off-by: Jamie Couture <jamie.couture@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/platform/darwin.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/platform/darwin.sh b/src/platform/darwin.sh index e4519ed..ce4bb29 100644 --- a/src/platform/darwin.sh +++ b/src/platform/darwin.sh @@ -31,5 +31,5 @@ tmpdir() { mount -t hfs -o noatime -o nobrowse "$DARWIN_RAMDISK_DEV" "$SECURE_TMPDIR" || die "Error: could not mount filesystem on ramdisk." } -GETOPT="$(brew --prefix gnu-getopt 2>/dev/null || echo /usr/local)/bin/getopt" +GETOPT="$(brew --prefix gnu-getopt 2>/dev/null || which port 2>/dev/null && echo /opt/local || echo /usr/local)/bin/getopt" SHRED="srm -f -z" |