[gnome-ostree/wip/new-model: 30/34] make: Limit the make builtin to always run a full build
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-ostree/wip/new-model: 30/34] make: Limit the make builtin to always run a full build
- Date: Thu, 11 Jul 2013 17:17:06 +0000 (UTC)
commit 7a7ce68c830a4b8839ea84e2b4f119dc5f5ac4a6
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Wed Jun 19 17:02:45 2013 -0400
make: Limit the make builtin to always run a full build
src/js/builtins/autobuilder.js | 5 +----
src/js/builtins/make.js | 12 ++----------
src/js/task.js | 25 ++++++++-----------------
3 files changed, 11 insertions(+), 31 deletions(-)
---
diff --git a/src/js/builtins/autobuilder.js b/src/js/builtins/autobuilder.js
index 7a56812..c1611f2 100644
--- a/src/js/builtins/autobuilder.js
+++ b/src/js/builtins/autobuilder.js
@@ -40,8 +40,6 @@ const Autobuilder = new Lang.Class({
this.parent();
this.parser.addArgument('--autoupdate-self', { action: 'store' });
- this.parser.addArgument('--skip', { action: 'append',
- help: "Don't process tasks after this" });
this._buildNeeded = true;
this._initialResolveNeeded = true;
@@ -64,8 +62,7 @@ const Autobuilder = new Lang.Class({
this._impl.export(Gio.DBus.session, '/org/gnome/OSTreeBuild/AutoBuilder');
this._taskmaster = new Task.TaskMaster(this.workdir.get_child('tasks'),
- { onEmpty: Lang.bind(this, this._onTasksComplete),
- skip: args.skip });
+ { 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..d84ab5b 100644
--- a/src/js/builtins/make.js
+++ b/src/js/builtins/make.js
@@ -32,11 +32,6 @@ const Make = new Lang.Class({
_init: function() {
this.parent();
- this.parser.addArgument(['-n', '--only'], { action: 'storeTrue',
- help: "Don't process tasks after this" });
- this.parser.addArgument(['-x', '--skip'], { action: 'append',
- help: "Don't process tasks after this" });
- this.parser.addArgument('taskname');
this.parser.addArgument('parameters', { nargs: '*' });
},
@@ -47,15 +42,12 @@ 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'),
- { onEmpty: Lang.bind(this, this._onTasksComplete),
- processAfter: !args.only,
- skip: args.skip });
+ let taskmaster = new Task.TaskMaster(this.workdir.get_child('tasks'), { onEmpty: Lang.bind(this,
this._onTasksComplete) });
this._taskmaster = taskmaster;
taskmaster.connect('task-executing', Lang.bind(this, this._onTaskExecuting));
taskmaster.connect('task-complete', Lang.bind(this, this._onTaskCompleted));
let params = this._parseParameters(args.parameters);
- taskmaster.pushTask(args.taskname, params);
+ taskmaster.pushTask('resolve', params);
loop.run();
if (!this._failed)
print("Success!")
diff --git a/src/js/task.js b/src/js/task.js
index 5969cae..bf3e4d7 100644
--- a/src/js/task.js
+++ b/src/js/task.js
@@ -125,14 +125,8 @@ const TaskMaster = new Lang.Class({
Name: 'TaskMaster',
_init: function(path, params) {
- params = Params.parse(params, { onEmpty: null,
- processAfter: true,
- skip: [] });
+ params = Params.parse(params, { onEmpty: null });
this.path = path;
- this._processAfter = params.processAfter;
- this._skipTasks = {};
- for (let i = 0; i < params.skip.length; i++)
- this._skipTasks[params.skip[i]] = true;
this.maxConcurrent = GLib.get_num_processors();
this._onEmpty = params.onEmpty;
this.cancellable = null;
@@ -279,16 +273,13 @@ const TaskMaster = new Lang.Class({
throw new Error("TaskMaster: Internal error - Failed to find completed task:" +
runner.taskData.name);
this._executing.splice(idx, 1);
this.emit('task-complete', runner, success, error);
- if (success && this._processAfter) {
- if (runner.changed) {
- let taskName = runner.taskData.name;
- let taskDef = runner.taskData.taskDef;
- let after = this._taskset.getTasksAfter(taskName);
- for (let i = 0; i < after.length; i++) {
- let afterTaskName = after[i];
- if (!this._skipTasks[afterTaskName])
- this.pushTask(afterTaskName, {});
- }
+ if (success && runner.changed) {
+ let taskName = runner.taskData.name;
+ let taskDef = runner.taskData.taskDef;
+ let after = this._taskset.getTasksAfter(taskName);
+ for (let i = 0; i < after.length; i++) {
+ let afterTaskName = after[i];
+ this.pushTask(afterTaskName, {});
}
}
this._queueRecalculate();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]