Fix remove deps from log

This commit is contained in:
Dimitris Zlatanidis 2024-03-16 22:12:07 +02:00
parent 04b3eb72f4
commit a026bc31d7

View file

@ -75,7 +75,7 @@ class RemovePackages(Configs):
name: str = self.utils.split_package(package)['name']
version: str = self.utils.split_package(package)['version']
for pkg, deps in self.deps_log.items():
if name in deps and pkg not in self.packages_for_remove:
if name in deps and pkg not in self.packages + self.dependencies:
self.found_dependent_packages[pkg] = version
if self.found_dependent_packages:
@ -91,7 +91,7 @@ class RemovePackages(Configs):
for dep in self.dependencies:
installed: str = self.utils.is_package_installed(dep)
if installed:
self.packages_for_remove.extend(installed)
self.packages_for_remove.append(installed)
def remove_packages(self) -> None:
print(f'Started of removing total ({self.cyan}{len(self.packages_for_remove)}{self.endc}) packages:\n')
@ -100,8 +100,9 @@ class RemovePackages(Configs):
progress_message: str = f'{self.bold}{self.red}Removing{self.endc}'
self.multi_proc.process(command, package, progress_message)
if package in self.deps_log.keys():
self.deps_log.pop(package)
name: str = self.utils.split_package(package)['name']
if name in self.deps_log.keys():
self.deps_log.pop(name)
self.deps_log_file.write_text(json.dumps(self.deps_log, indent=4))