Blob Blame History Raw
commit c9a01198d494f06ae9e0b3e2a002f941da118f00
Author: Richard Hughes <richard@hughsie.com>
Date:   Tue Sep 23 10:45:23 2008 +0100

    bugfix: don't send ::Finished() when the script exits because of a dispatcher exit
    
    What we are seeing here is the backend being finished when it is in another transaction
    and hence returns no results and then puts up warnings that there was no status reports.
    This only seems to happen when we are making the dispatcher be reloaded again and again,
    for instance using pk-import-specspo and a RefreshCache() at the same time

diff --git a/src/pk-backend-spawn.c b/src/pk-backend-spawn.c
index 5609580..9878340 100644
--- a/src/pk-backend-spawn.c
+++ b/src/pk-backend-spawn.c
@@ -409,8 +409,12 @@ pk_backend_spawn_exit_cb (PkSpawn *spawn, PkSpawnExitType exit, PkBackendSpawn *
 
 	/* only emit if not finished */
 	if (!backend_spawn->priv->finished) {
-		egg_debug ("script exited without doing finished");
-		pk_backend_finished (backend_spawn->priv->backend);
+		/* ignore when we exit from a dispatcher */
+		if (exit != PK_SPAWN_EXIT_TYPE_DISPATCHER_EXIT &&
+		    exit != PK_SPAWN_EXIT_TYPE_DISPATCHER_CHANGED) {
+			egg_warning ("script exited without doing finished");
+			pk_backend_finished (backend_spawn->priv->backend);
+		}
 	}
 }