From 354a1d9ac5743751e53b18702ee7e3e358c9cec9 Mon Sep 17 00:00:00 2001 From: zx Date: Thu, 7 Nov 2024 22:31:43 -0500 Subject: [PATCH] fix: not auto-injecting already fixed dependency names whoops --- cyan/tbhtypes/executable.py | 15 ++++++++------- cyan/tbhtypes/main_executable.py | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/cyan/tbhtypes/executable.py b/cyan/tbhtypes/executable.py index b2c3896..4a8603f 100644 --- a/cyan/tbhtypes/executable.py +++ b/cyan/tbhtypes/executable.py @@ -84,15 +84,16 @@ class Executable: for dep in self.get_dependencies(): for common, info in self.common.items(): - if common in dep.lower() and dep != info["path"]: - self.change_dependency(dep, info["path"]) - print( - f"[*] fixed common dependency in {self.bn}: " - f"{dep} -> {info['path']}" - ) - + if common in dep.lower(): needed.add(common) + if dep != info["path"]: + self.change_dependency(dep, info["path"]) + print( + f"[*] fixed common dependency in {self.bn}: " + f"{dep} -> {info['path']}" + ) + def fix_dependencies(self, tweaks: dict[str, str]) -> None: for dep in self.get_dependencies(): for cname in tweaks: diff --git a/cyan/tbhtypes/main_executable.py b/cyan/tbhtypes/main_executable.py index 954cfc6..6ce13dc 100644 --- a/cyan/tbhtypes/main_executable.py +++ b/cyan/tbhtypes/main_executable.py @@ -5,7 +5,7 @@ import subprocess from typing import Optional try: - import lief + import lief # type: ignore except Exception: pass