[gnome-continuous] task: Pass the workdir directly into the TaskMaster
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-continuous] task: Pass the workdir directly into the TaskMaster
- Date: Wed, 2 Oct 2013 18:11:53 +0000 (UTC)
commit 48be0f13f8c1188a5bdd3ecb6017d085a8354970
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Mon Sep 30 15:00:44 2013 -0400
task: Pass the workdir directly into the TaskMaster
The TaskMaster clearly wants the workdir as we do get_parent, so simply
pass that in.
src/js/builtins/autobuilder.js | 2 +-
src/js/builtins/make.js | 2 +-
src/js/task.js | 12 ++++++++----
3 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/src/js/builtins/autobuilder.js b/src/js/builtins/autobuilder.js
index 511f04a..5865f75 100644
--- a/src/js/builtins/autobuilder.js
+++ b/src/js/builtins/autobuilder.js
@@ -61,7 +61,7 @@ const Autobuilder = new Lang.Class({
this._impl = Gio.DBusExportedObject.wrapJSObject(AutoBuilderIface, this);
this._impl.export(Gio.DBus.session, '/org/gnome/OSTreeBuild/AutoBuilder');
- this._taskmaster = new Task.TaskMaster(this.workdir.get_child('tasks'),
+ this._taskmaster = new Task.TaskMaster(this.workdir,
{ onEmpty: Lang.bind(this, this._onTasksComplete) });
this._taskmaster.connect('task-executing', Lang.bind(this, this._onTaskExecuting));
this._taskmaster.connect('task-complete', Lang.bind(this, this._onTaskCompleted));
diff --git a/src/js/builtins/make.js b/src/js/builtins/make.js
index db35fc3..a40455c 100644
--- a/src/js/builtins/make.js
+++ b/src/js/builtins/make.js
@@ -47,7 +47,7 @@ const Make = new Lang.Class({
this._cancellable = cancellable;
this._tasksComplete = false;
this._oneOnly = args.only;
- let taskmaster = new Task.TaskMaster(this.workdir.get_child('tasks'),
+ let taskmaster = new Task.TaskMaster(this.workdir,
{ onEmpty: Lang.bind(this, this._onTasksComplete),
processAfter: !args.only,
skip: args.skip });
diff --git a/src/js/task.js b/src/js/task.js
index 7ce83dc..b861122 100644
--- a/src/js/task.js
+++ b/src/js/task.js
@@ -125,11 +125,15 @@ const TaskData = new Lang.Class({
const TaskMaster = new Lang.Class({
Name: 'TaskMaster',
- _init: function(path, params) {
+ _init: function(workdir, params) {
params = Params.parse(params, { onEmpty: null,
processAfter: true,
skip: [] });
- this.path = path;
+
+ this.workdir = workdir;
+ this.tasksPath = workdir.get_child('tasks');
+ GSystem.file_ensure_directory(this.tasksPath, true, null);
+
this._processAfter = params.processAfter;
this._skipTasks = {};
for (let i = 0; i < params.skip.length; i++)
@@ -359,7 +363,7 @@ const TaskRunner = new Lang.Class({
this.onComplete = onComplete;
this.name = taskData.name;
- this.workdir = taskmaster.path.get_parent();
+ this.workdir = taskmaster.workdir;
BuildUtil.checkIsWorkDirectory(this.workdir);
},
@@ -390,7 +394,7 @@ const TaskRunner = new Lang.Class({
this._startTimeMillis = GLib.get_monotonic_time() / 1000;
- this.dir = this.taskmaster.path.resolve_relative_path(this.name);
+ this.dir = this.taskmaster.tasksPath.resolve_relative_path(this.name);
GSystem.file_ensure_directory(this.dir, true, cancellable);
this._topDir = new VersionedDir.VersionedDir(this.dir, this._VERSION_RE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]