mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-09-19 04:59:01 +00:00
upgrades: Cleanup dist upgrade steps specific to bullseye release
- Skip handling of obsolete packages if there are none. - Skip handling of debconf selections if none are required. - Handle tt-rss same as other packages with prompts. Signed-off-by: James Valleroy <jvalleroy@mailbox.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
690859b02f
commit
32d9f01597
@ -89,23 +89,15 @@ Pin: release a=buster-backports
|
|||||||
Pin-Priority: 500
|
Pin-Priority: 500
|
||||||
'''
|
'''
|
||||||
|
|
||||||
DIST_UPGRADE_OBSOLETE_PACKAGES = ['libgcc1']
|
DIST_UPGRADE_OBSOLETE_PACKAGES = []
|
||||||
|
|
||||||
DIST_UPGRADE_PACKAGES_WITH_PROMPTS = [
|
DIST_UPGRADE_PACKAGES_WITH_PROMPTS = [
|
||||||
'firewalld', 'mumble-server', 'radicale', 'roundcube-core'
|
'firewalld', 'mumble-server', 'radicale', 'roundcube-core', 'tt-rss'
|
||||||
]
|
]
|
||||||
|
|
||||||
# These are packages that may not be available in the next stable release.
|
DIST_UPGRADE_PRE_INSTALL_PACKAGES = ['base-files']
|
||||||
DIST_UPGRADE_OPTIONAL_PACKAGES_WITH_PROMPTS = ['tt-rss']
|
|
||||||
|
|
||||||
DIST_UPGRADE_PRE_INSTALL_PACKAGES = [
|
DIST_UPGRADE_PRE_DEBCONF_SELECTIONS = []
|
||||||
'base-files', 'python3-systemd', 'unattended-upgrades'
|
|
||||||
]
|
|
||||||
|
|
||||||
DIST_UPGRADE_PRE_DEBCONF_SELECTIONS = [
|
|
||||||
# Tell grub-pc to continue without installing grub again.
|
|
||||||
'grub-pc grub-pc/install_devices_empty boolean true'
|
|
||||||
]
|
|
||||||
|
|
||||||
DIST_UPGRADE_REQUIRED_FREE_SPACE = 5000000
|
DIST_UPGRADE_REQUIRED_FREE_SPACE = 5000000
|
||||||
|
|
||||||
@ -517,10 +509,11 @@ def _perform_dist_upgrade():
|
|||||||
|
|
||||||
# Pre-set debconf selections if they are required during the
|
# Pre-set debconf selections if they are required during the
|
||||||
# dist upgrade.
|
# dist upgrade.
|
||||||
print(
|
if DIST_UPGRADE_PRE_DEBCONF_SELECTIONS:
|
||||||
f'Setting debconf selections: '
|
print(
|
||||||
f'{DIST_UPGRADE_PRE_DEBCONF_SELECTIONS}', flush=True)
|
f'Setting debconf selections: '
|
||||||
debconf_set_selections(DIST_UPGRADE_PRE_DEBCONF_SELECTIONS)
|
f'{DIST_UPGRADE_PRE_DEBCONF_SELECTIONS}', flush=True)
|
||||||
|
debconf_set_selections(DIST_UPGRADE_PRE_DEBCONF_SELECTIONS)
|
||||||
|
|
||||||
# This will upgrade most of the packages.
|
# This will upgrade most of the packages.
|
||||||
print('Running unattended-upgrade...', flush=True)
|
print('Running unattended-upgrade...', flush=True)
|
||||||
@ -528,25 +521,23 @@ def _perform_dist_upgrade():
|
|||||||
|
|
||||||
# Remove obsolete packages that may prevent other packages from
|
# Remove obsolete packages that may prevent other packages from
|
||||||
# upgrading.
|
# upgrading.
|
||||||
print(f'Removing packages: {DIST_UPGRADE_OBSOLETE_PACKAGES}...',
|
if DIST_UPGRADE_OBSOLETE_PACKAGES:
|
||||||
flush=True)
|
print(f'Removing packages: {DIST_UPGRADE_OBSOLETE_PACKAGES}...',
|
||||||
run_apt_command(['remove'] + DIST_UPGRADE_OBSOLETE_PACKAGES)
|
flush=True)
|
||||||
|
run_apt_command(['remove'] + DIST_UPGRADE_OBSOLETE_PACKAGES)
|
||||||
|
|
||||||
# Hold packages known to have conffile prompts. FreedomBox service
|
# Hold packages known to have conffile prompts. FreedomBox service
|
||||||
# will handle their upgrade later.
|
# will handle their upgrade later.
|
||||||
print(
|
print(
|
||||||
'Holding packages with conffile prompts: ' +
|
'Holding packages with conffile prompts: ' +
|
||||||
', '.join(DIST_UPGRADE_PACKAGES_WITH_PROMPTS) + '...', flush=True)
|
', '.join(DIST_UPGRADE_PACKAGES_WITH_PROMPTS) + '...', flush=True)
|
||||||
|
# XXX: If any of these packages have been removed from the
|
||||||
|
# next stable release, they will causes the hold command to
|
||||||
|
# fail for all packages. So it would be safer to just hold one
|
||||||
|
# package at a time.
|
||||||
with apt_hold(DIST_UPGRADE_PACKAGES_WITH_PROMPTS):
|
with apt_hold(DIST_UPGRADE_PACKAGES_WITH_PROMPTS):
|
||||||
# TODO: Support holding more than 1 package here.
|
print('Running apt full-upgrade...', flush=True)
|
||||||
print(
|
run_apt_command(['full-upgrade'])
|
||||||
f'Holding packages if available: '
|
|
||||||
f'{DIST_UPGRADE_OPTIONAL_PACKAGES_WITH_PROMPTS[0]}...',
|
|
||||||
flush=True)
|
|
||||||
with apt_hold([DIST_UPGRADE_OPTIONAL_PACKAGES_WITH_PROMPTS[0]],
|
|
||||||
ignore_errors=True):
|
|
||||||
print('Running apt full-upgrade...', flush=True)
|
|
||||||
run_apt_command(['full-upgrade'])
|
|
||||||
|
|
||||||
_update_searx(reenable_searx)
|
_update_searx(reenable_searx)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user