[gnome-continuous] Write meta.json from task.js consistently



commit f8ab7fc671ae1dc1e00729ec79ba25a364866688
Author: Colin Walters <walters verbum org>
Date:   Sun Nov 17 19:07:57 2013 -0500

    Write meta.json from task.js consistently
    
    The autobuilder had leftover code to create a meta.json, but this is
    wrong - task.js knows all of the information.

 src/js/builtins/autobuilder.js |    5 +----
 src/js/task.js                 |    9 +++++++++
 2 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/src/js/builtins/autobuilder.js b/src/js/builtins/autobuilder.js
index 4808b0e..dfa51a2 100644
--- a/src/js/builtins/autobuilder.js
+++ b/src/js/builtins/autobuilder.js
@@ -58,7 +58,7 @@ const Autobuilder = new Lang.Class({
     execute: function(args, loop, cancellable) {
        this._initWorkdir(null, cancellable);
 
-        this._buildsDir = new VersionedDir.VersionedDir(this.workdir.get_child('builds'), this._VERSION_RE);
+        this._buildsDir = new VersionedDir.VersionedDir(this.workdir.get_child('builds'));
 
         this._resultsDir = this.workdir.get_child('results');
         GSystem.file_ensure_directory(this._resultsDir, true, cancellable);
@@ -191,9 +191,6 @@ const Autobuilder = new Lang.Class({
             BuildUtil.atomicSymlinkSwap(buildPath.get_child('last-build'), lastBuildPath, null);
         }
 
-        let meta = { "version": version };
-        JsonUtil.writeJsonFileAtomic(buildPath.get_child('meta.json'), meta, cancellable);
-
        if (this._initialResolveNeeded) {
            this._initialResolveNeeded = false;
            this._taskmaster.pushTask(buildPath, 'resolve', { });
diff --git a/src/js/task.js b/src/js/task.js
index 2089706..c16cc3e 100644
--- a/src/js/task.js
+++ b/src/js/task.js
@@ -413,6 +413,14 @@ const TaskRunner = new Lang.Class({
        this._proc = new GSystem.Subprocess({ context: context });
        this._proc.init(cancellable);
 
+       let targetPath = this.workdir.get_relative_path(this.taskCwd);
+
+       let meta = { taskMetaVersion: 0,
+                     buildName: this.buildName,
+                    complete: false,
+                    path: targetPath };
+       JsonUtil.writeJsonFileAtomic(this.taskCwd.get_child('meta.json'), meta, cancellable);
+
        this._proc.wait(cancellable, Lang.bind(this, this._onChildExited));
     },
 
@@ -438,6 +446,7 @@ const TaskRunner = new Lang.Class({
 
        let meta = { taskMetaVersion: 0,
                      buildName: this.buildName,
+                    complete: true,
                     success: success,
                     errmsg: errmsg,
                     elapsedMillis: elapsedMillis,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]