diff --git a/actions/upgrades b/actions/upgrades index ee278845d..c54f81c5b 100755 --- a/actions/upgrades +++ b/actions/upgrades @@ -384,12 +384,12 @@ def _check_and_dist_upgrade(develop=False, test_upgrade=False): def _perform_dist_upgrade(): """Perform upgrade to next release of Debian.""" # Hold freedombox package during entire dist upgrade. - print('Holding freedombox package...') + print('Holding freedombox package...', flush=True) with apt_hold(): - print('Updating Apt cache...') + print('Updating Apt cache...', flush=True) run_apt_command(['update']) - print('Upgrading base-files and unattended-upgrades...') + print('Upgrading base-files and unattended-upgrades...', flush=True) run_apt_command(['install', 'base-files']) run_apt_command(['install', 'unattended-upgrades']) @@ -403,29 +403,35 @@ def _perform_dist_upgrade(): # Remove obsolete packages that may prevent other packages from # upgrading. - print('Removing libgcc1...') + print('Removing libgcc1...', flush=True) run_apt_command(['remove', 'libgcc1']) # Hold packages known to have conffile prompts. FreedomBox service # will handle their upgrade later. packages_with_prompts = ['firewalld', 'mumble-server', 'radicale'] - print('Holding packages with conffile prompts: ' + - ', '.join(packages_with_prompts) + '...') + print( + 'Holding packages with conffile prompts: ' + + ', '.join(packages_with_prompts) + '...', flush=True) with apt_hold(packages_with_prompts): - print('Running apt full-upgrade...') + print('Running apt full-upgrade...', flush=True) run_apt_command(['full-upgrade']) - print('Running apt autoremove...') + # If searx is installed, update search engines list. + if pathlib.Path('/etc/searx/settings.yml').exists(): + print('Updating searx search engines list...', flush=True) + subprocess.run(['./searx', 'setup'], check=True) + + print('Running apt autoremove...', flush=True) run_apt_command(['autoremove']) - print('Dist upgrade complete. Removing flag.') + print('Dist upgrade complete. Removing flag.', flush=True) if dist_upgrade_flag.exists(): dist_upgrade_flag.unlink() # FreedomBox Service may have tried to restart several times # during the upgrade, but failed. It will stop trying after 5 # retries. Restart it once more to ensure it is running. - print('Restarting FreedomBox service...') + print('Restarting FreedomBox service...', flush=True) service_restart('plinth')