summaryrefslogtreecommitdiff
path: root/src/core/transaction.c
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2012-04-20 02:04:01 +0200
committerMichal Schmidt <mschmidt@redhat.com>2012-04-20 17:12:28 +0200
commit05d576f1f77699ea5c2e5ed0e04451b14dfc45a0 (patch)
tree08ce135a80c8dd15866925fcbe30341fbf028746 /src/core/transaction.c
parentf1c2bdca422dba1bc5615f72662dee5ce69c147b (diff)
job: separate job_install()
Let the jobs install themselves.
Diffstat (limited to 'src/core/transaction.c')
-rw-r--r--src/core/transaction.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/src/core/transaction.c b/src/core/transaction.c
index 41f7b82fb..d495cbddc 100644
--- a/src/core/transaction.c
+++ b/src/core/transaction.c
@@ -592,33 +592,19 @@ static int transaction_apply(Transaction *tr, Manager *m, JobMode mode) {
}
while ((j = hashmap_steal_first(tr->jobs))) {
- Job *uj;
if (j->installed) {
/* log_debug("Skipping already installed job %s/%s as %u", j->unit->id, job_type_to_string(j->type), (unsigned) j->id); */
continue;
}
- uj = j->unit->job;
- if (uj) {
- job_uninstall(uj);
- job_free(uj);
- }
-
- j->unit->job = j;
- j->installed = true;
- m->n_installed_jobs ++;
-
- /* We're fully installed. Now let's free data we don't
- * need anymore. */
-
/* Clean the job dependencies */
transaction_unlink_job(tr, j, false);
+ job_install(j);
+
job_add_to_run_queue(j);
job_add_to_dbus_queue(j);
job_start_timer(j);
-
- log_debug("Installed new job %s/%s as %u", j->unit->id, job_type_to_string(j->type), (unsigned) j->id);
}
return 0;