Skip to content

Commit

Permalink
patch
Browse files Browse the repository at this point in the history
  • Loading branch information
lbr38 committed Sep 5, 2024
1 parent 44882a6 commit 630449c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/controllers/Package/Apt.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@ def __init__(self):
# Create an instance of the apt cache
self.aptcache = apt.Cache()

# self.aptcache.update()
# self.aptcache.open(None)
self.aptcache.open(None)
self.aptcache.update()

# TODO debug
# Print content of apt cache
self.aptcache.upgrade()
self.aptcache.open(None)
to_update = self.aptcache.get_changes()

# for pkg in self.aptcache:
Expand Down Expand Up @@ -80,16 +79,17 @@ def get_installed_packages(self):
#-----------------------------------------------------------------------------------------------
def get_available_packages(self, dist_upgrade: bool = False):
try:
list = []

aptcache = apt.Cache()
aptcache.open(None)

aptcache.clear()
aptcache.update()

list = []

# Simulate an upgrade
# self.aptcache.upgrade(dist_upgrade)
aptcache.upgrade(dist_upgrade)
aptcache.open(None)

# TODO debug
print('total 2: ' + str(len(aptcache.get_changes())))
Expand Down

0 comments on commit 630449c

Please sign in to comment.