From e6a75a7fb8f0bc1a2a2020dbc5b7b1dee31a9e2f Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Tue, 26 Apr 2011 08:35:53 +0200 Subject: [PATCH] [equo] respawn equo if, after the installation of all the updates, there are more (critical updates case) --- client/text_ui.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/client/text_ui.py b/client/text_ui.py index 29dab0dc1..033e78656 100644 --- a/client/text_ui.py +++ b/client/text_ui.py @@ -15,6 +15,7 @@ ## Packages user handling function # import os +import sys import shutil import tempfile @@ -530,8 +531,24 @@ def upgrade_packages(entropy_client, onlyfetch = False, replay = False, # Entropy Client SystemSettings plugin entropy_client.Settings().clear() + if update: + # if updates have been installed, check if there are more + # to come (perhaps critical updates were installed) + _upgrade_packages_respawn(entropy_client) + return 0, 0 +def _upgrade_packages_respawn(entropy_client): + # It might be an Entropy bug and Entropy was proritized in the + # install queue, ignoring the rest of available packages. + # So, respawning myself again using execv() should be a much + # better idea. + update, remove, fine, spm_fine = entropy_client.calculate_updates() + if update: + # then spawn a new process + entropy_client.shutdown() + os.execv(sys.argv[0], sys.argv) + def branch_hop(entropy_client, branch): # check if I am root