Speedup pass on macOS and brew

pass-maillinglist at artursterz.de pass-maillinglist at artursterz.de
Tue Oct 23 13:11:39 CEST 2018



> Both of your suggestions assume that if Homebrew or Macports is installed, then
> getopt must be installed by that tool, which may be wrong.

I’m not sure if you are right. To break it down, the original version does the following:

First, it tries to get the path from brew. If that fails, it will try to get the path using Macports. If this also fails, the last chance is to use a hard coded path.
I think it is a somewhat reasonable assumption, that on macOS gnu-getopt is installed by either of the first two options.

The main problem is, that macOS ships its own version of getopt, which does not work as expected. So, we need to determine the path to gnu-getopt wihtout falling back to the default macOS version. The easiest way would be to look into $PATH. But this won’t work, since brew does not install gnu-getopt into $PATH. Forcing users to do so is also not a practical option.
Therefore, we should stick to Allan’s version.

But you are right in one part, Amir. Just because brew or macports are installed doesn't mean that gnu-getopts was installed with either tool. Therefore, we should check if either is installed AND if gnu-getopt is in the path we assume. If nothing is true, then (and only then) use any reasonable fall back.

But I have to think about it and make a diff as soon as I am ready.


More information about the Password-Store mailing list