Skip to content

Commit

Permalink
Do not resolve symlinks.
Browse files Browse the repository at this point in the history
  • Loading branch information
kdeldycke committed Jan 3, 2021
1 parent 14c7fcc commit fab71ac
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
15 changes: 9 additions & 6 deletions meta_package_manager/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,16 @@ def cli_path(self):
logger.debug(f"{self.cli_name} CLI not found.")
return

# Normalize CLI path and check it is a file.
cli_path = Path(cli_path).resolve(strict=True)
logger.debug(f"CLI found at {cli_path}")

if not cli_path.is_file():
# Check if path exist and is a file.
# Do not resolve symlink here. Some manager like Homebrew on Linux rely on some
# sort of synlink trickery to set environment variables.
cli_path = Path(cli_path)
if not cli_path.exists():
raise FileNotFoundError(f"{cli_path}")
elif not cli_path.is_file():
logger.warning(f"{cli_path} is not a file.")
return
else:
logger.debug(f"CLI found at {cli_path}")

return cli_path

Expand Down
3 changes: 0 additions & 3 deletions meta_package_manager/managers/homebrew.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ class Homebrew(PackageManager):
# 2.7.0 is the first release to enforce the use of --cask option.
requirement = "2.7.0"

# Help mpm a little bit in its search for the `brew` binary on Linux.
cli_search_path = ["~/.linuxbrew"]

# Declare this manager as virtual, i.e. not tied to a real CLI.
cli_name = None

Expand Down

0 comments on commit fab71ac

Please sign in to comment.