mtrojnar / osslsigncode

OpenSSL based Authenticode signing for PE/MSI/Java CAB files
Other
806 stars 131 forks source link

make `SetBashCompletion` optional #177

Closed chenrui333 closed 1 year ago

chenrui333 commented 2 years ago

While trying to upgrade the formula to use the latest release 2.5, I found it would be better to make SetBashCompletion optional (not only to pass the build on my side, but also delegate this to package manager to install the shell-specific completion files).

Below is the build error that I ran into:

cmake
--install
build

-- Install configuration: "Release"
-- Installing: /opt/homebrew/Cellar/bash-completion@2/2.11/share/bash-completion/completions/osslsigncode.bash
CMake Error at build/cmake_install.cmake:49 (file):
  file INSTALL cannot copy file
  "/tmp/osslsigncode-20220813-29510-1b5otm1/osslsigncode-2.5/osslsigncode.bash"
  to
  "/opt/homebrew/Cellar/bash-completion@2/2.11/share/bash-completion/completions/osslsigncode.bash":
  Operation not permitted.

Let me know if that makes sense.

mtrojnar commented 2 years ago

What would be a good example of a package installing bash completions the way you like it? I'd like to avoid implementing installer in a non-standard way (https://en.wikipedia.org/wiki/Principle_of_least_astonishment).

chenrui333 commented 2 years ago

The proposed solution is trying to fix the operations not permitted issue.

I can think of two ways of doing that:

mtrojnar commented 2 years ago

@chenrui333 Yes, we already figured out your problem. I recommend starting with problem statement instead of a proposed solution next time you report a bug. This great page may be useful: http://www.catb.org/~esr/faqs/smart-questions.html

My ideas for fixing it (in the order of preferences):

  1. Add an option override the autodetected directory for installing bash completions.
  2. Add an option to skip installing bash completions.
  3. Ignore errors when installing bash completions.

What do you think?

chenrui333 commented 2 years ago

@chenrui333 Yes, we already figured out your problem. I recommend starting with problem statement instead of a proposed solution next time you report a bug. This great page may be useful: http://www.catb.org/~esr/faqs/smart-questions.html

yeah, totally, I will focus on the problem next time rather than presenting the solution idea next time 😄

My ideas for fixing it (in the order of preferences):

  1. Add an option override the autodetected directory for installing bash completions.
  2. Add an option to skip installing bash completions.
  3. Ignore errors when installing bash completions.

That is exactly what I was thinking, thanks!

What do you think?