Skip to content
This repository has been archived by the owner on Jul 24, 2020. It is now read-only.

enhance the installation detection of involucro #111

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

bgruening
Copy link
Member

fixes: #110

@@ -285,7 +286,9 @@ def exec_command(self, involucro_args):
return res

def is_installed(self):
return os.path.exists(self.involucro_bin)
if find_executable('involucro') is not None or os.path.exists(self.involucro_bin):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

distutils.spawn.find_executable only does half the job of shutil.which, i.e., it is only checking for existence but not user executability.
I think (given a shutil.which implementation) you'd want something like

if not os.path.dirname(self.involucro_bin):
    return shutil.which(self.involucro_bin)
return (os.access(self.involucro_bin, os.F_OK | os.X_OK) and not os.path.isdir(self.involucro_bin))

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mbargull missed that, sorry. Do you think if we find the binary, but it is not executable, that we should install/download a new binary? We should probably error out, isn't it?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Faulty path detection for involucro
2 participants