lastpass / lastpass-cli

LastPass command line interface tool
GNU General Public License v2.0
2.85k stars 292 forks source link

Install bash-completions in PREFIX dir structure #483

Closed waterkip closed 5 years ago

waterkip commented 5 years ago

The problem is that the bash completion dir uses a different prefix when found by pkg-config. If the prefix is the same, all is well, otherwise users end up looking for a different location and may suffer from permissions denied errors.

This changeset fixes this by regex replacing the prefix of the path bash completion directory. This changeset includes a change to the lookup method for pkg-config vars. It has been changed to reflect the API of FindPkgConfig. There are a lot of if-statements added to check which version of CMake is used. This may not be needed, but.. this will help any upgrade to CMake 3.4 and up. After which most of the code that has been introduced by the changeset can be removed \o/.

Fixes: #478

Signed-off-by: Wesley Schwengle wesley@schwengle.net

darcyparker commented 5 years ago

I verified that building src and installing from this branch while $PREFIX=/usr/local resolves #478. This allows make install without being sudoer or root user to a dir I have access to.