<div dir="ltr"> I recently had pass stop working out of the blue, saying `getopt` was not available. After a bit of digging, I found that the issue was that `brew` needed me to accept the XCode license again for some reason. That (I guess) returned a non-zero status code, which pass (I guess) took to mean `brew` was not part of the picture. Accepting this license may be necessary for brew to work, but it should not be necessary for pass to use the already installed `gnu-getopt`, and the bug was a bit of a pain to track down.<div><br></div><div>So add another pro to Allan’s list: `pass` would not be affected when brew (or one of its dependencies) starts throwing a fit.</div><div><br></div><div><div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">—<div>Alfonso Gómez-Arzola</div></div></div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 26, 2019 at 3:19 AM Allan Odgaard <<a href="mailto:lists%2Bpass@simplit.com">lists+pass@simplit.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>




<div>
<div style="font-family:sans-serif"><div style="white-space:normal">
<p dir="auto">On 26 Oct 2018, at 12:12, <a href="mailto:pass-maillinglist@artursterz.de" style="color:rgb(57,131,196)" target="_blank">pass-maillinglist@artursterz.de</a> wrote:</p>

</div>
<div style="white-space:normal"><blockquote style="border-left:2px solid rgb(119,119,119);color:rgb(119,119,119);margin:0px 0px 5px;padding-left:5px"><p dir="auto">All right, looks like I have found a good solution thanks to my teammate Jonas. It’s a multi-staged lookup. First, look in $PATH, if it’s not there, try to get it from brew, then from macports.</p>
</blockquote></div>
<div style="white-space:normal">

<p dir="auto">I came to the realization that <code style="background-color:rgb(247,247,247);border-radius:3px;margin:0px;padding:0px 0.4em" bgcolor="#F7F7F7">pass</code> should <em>not</em> try to guess which package manager can provide <code style="background-color:rgb(247,247,247);border-radius:3px;margin:0px;padding:0px 0.4em" bgcolor="#F7F7F7">gnu-getopt</code>.</p>

<p dir="auto">If the user has a package manager, it is only reasonable to assume <code style="background-color:rgb(247,247,247);border-radius:3px;margin:0px;padding:0px 0.4em" bgcolor="#F7F7F7">pass</code> was installed using a package manager, and therefore the package manager should patch <code style="background-color:rgb(247,247,247);border-radius:3px;margin:0px;padding:0px 0.4em" bgcolor="#F7F7F7">pass</code> to use <code style="background-color:rgb(247,247,247);border-radius:3px;margin:0px;padding:0px 0.4em" bgcolor="#F7F7F7">gnu-getopt</code> provided by the package manager (and setup as a dependency).</p>

<p dir="auto">So by default, <code style="background-color:rgb(247,247,247);border-radius:3px;margin:0px;padding:0px 0.4em" bgcolor="#F7F7F7">pass</code> should simply use <code style="background-color:rgb(247,247,247);border-radius:3px;margin:0px;padding:0px 0.4em" bgcolor="#F7F7F7">getopt</code> via <code style="background-color:rgb(247,247,247);border-radius:3px;margin:0px;padding:0px 0.4em" bgcolor="#F7F7F7">PATH</code> or possibly <code style="background-color:rgb(247,247,247);border-radius:3px;margin:0px;padding:0px 0.4em" bgcolor="#F7F7F7">gnu-getopt</code> or <code style="background-color:rgb(247,247,247);border-radius:3px;margin:0px;padding:0px 0.4em" bgcolor="#F7F7F7">/usr/local/bin/getopt</code> to avoid any issues that could arise by calling the system’s <code style="background-color:rgb(247,247,247);border-radius:3px;margin:0px;padding:0px 0.4em" bgcolor="#F7F7F7">getopt</code>.</p>

<p dir="auto">What do you think about this?</p>

<h3 style="font-size:1.1em">Pro</h3>

<ol>
<li value="1">Avoids run-time check for <code style="background-color:rgb(247,247,247);border-radius:3px;margin:0px;padding:0px 0.4em" bgcolor="#F7F7F7">brew</code> etc.</li>
<li value="2">Avoids assumptions about where <code style="background-color:rgb(247,247,247);border-radius:3px;margin:0px;padding:0px 0.4em" bgcolor="#F7F7F7">brew</code> etc. actually installs <code style="background-color:rgb(247,247,247);border-radius:3px;margin:0px;padding:0px 0.4em" bgcolor="#F7F7F7">gnu-getopt</code>.</li>
<li value="3">Allows user to have multiple package managers without <code style="background-color:rgb(247,247,247);border-radius:3px;margin:0px;padding:0px 0.4em" bgcolor="#F7F7F7">pass</code> trying to use <code style="background-color:rgb(247,247,247);border-radius:3px;margin:0px;padding:0px 0.4em" bgcolor="#F7F7F7">gnu-getopt</code> from the “wrong” one.</li>
</ol>

<h3 style="font-size:1.1em">Con</h3>

<ol>
<li value="1">Each package manager will need to patch <code style="background-color:rgb(247,247,247);border-radius:3px;margin:0px;padding:0px 0.4em" bgcolor="#F7F7F7">platform/darwin.sh</code></li>
</ol>
</div>
</div>
</div>

_______________________________________________<br>
Password-Store mailing list<br>
<a href="mailto:Password-Store@lists.zx2c4.com" target="_blank">Password-Store@lists.zx2c4.com</a><br>
<a href="https://lists.zx2c4.com/mailman/listinfo/password-store" rel="noreferrer" target="_blank">https://lists.zx2c4.com/mailman/listinfo/password-store</a><br>
</blockquote></div>