mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
package: Uninstall packages even if they are not in apt cache
Tests: - Install matrix-synapse app by adding 'unstable' in apt sources.list. Then remove 'unstable' from apt sources.list. Then matrix-synapse package will no longer be found in the apt's cache. - Try to uninstall the package. Without patch, the process errors out. With patch, uninstall completes successfully. - While matrix-synapse app is installed and apt cache does not contain matrix-synapse package, install and uninstall bepasty app. Without patch, uninstall fails. With patch, uninstall succeeds. - Install and uninstall minetest app. 3d armor mod package is successfully installed. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
This commit is contained in:
parent
3f19c91007
commit
e26a4b71eb
@ -194,8 +194,11 @@ class Packages(app_module.FollowerComponent):
|
||||
# Ensure package list is update-to-date before looking at dependencies.
|
||||
refresh_package_lists()
|
||||
|
||||
# List of packages to purge from the system
|
||||
packages = self.get_actual_packages()
|
||||
# List of packages to purge from the system. Be resilient to a package
|
||||
# not being found in apt's cache by not using get_actual_packages(). If
|
||||
# a package expression is listed as (package1 | package2) then try to
|
||||
# remove both packages.
|
||||
packages = self.possible_packages
|
||||
logger.info('App\'s list of packages to remove: %s', packages)
|
||||
|
||||
packages = self._filter_packages_to_keep(packages)
|
||||
@ -304,7 +307,7 @@ class Packages(app_module.FollowerComponent):
|
||||
|
||||
# Remove packages used by other installed apps
|
||||
for component in app.get_components_of_type(Packages):
|
||||
keep_packages |= set(component.get_actual_packages())
|
||||
keep_packages |= set(component.possible_packages)
|
||||
|
||||
# Get list of all the dependencies of packages to keep.
|
||||
keep_packages_with_deps: set[str] = set()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user