Updated transaction.py

When computing, the package is added to the final state.

Added more logging statements

Fixed bugs for annotations
This commit is contained in:
Ethan Smith-Coss 2023-08-12 16:37:05 +01:00
parent 8dc0e10969
commit 353dc3f768
Signed by: TheOnePath
GPG Key ID: 4E7D436CE1A0BAF1

View File

@ -22,12 +22,13 @@ class Transaction:
self.pkg_goal: PkgGoal = goal self.pkg_goal: PkgGoal = goal
def compute(self, pkgs: list[bottler._Soybottle]) -> tuple: def compute(self, pkgs: list[bottler.PackageItem]) -> tuple:
"""Compute dependencies and conflicts of packages. Returns a list of total packages to install.""" """Compute dependencies and conflicts of packages. Returns a list of total packages to install."""
self._final_state = [] self._final_state = []
sys_depends = [] sys_depends = []
for pkg in pkgs: for pkg in pkgs:
... # add the package itself to the final state since it can be installed
self._final_state.append(pkg)
# :@TODO: compute the dependencies # :@TODO: compute the dependencies
return tuple(sys_depends) return tuple(sys_depends)
@ -35,7 +36,7 @@ class Transaction:
def apply(self): def apply(self):
if self.pkg_goal == PkgGoal.PKG_INSTALL: if self.pkg_goal == PkgGoal.PKG_INSTALL:
ops.install_packages(self._final_state) ops.install_packages(self, self._final_state)
def problems(self) -> tuple: def problems(self) -> tuple: