[gnome-continuous] Fix buildName for builddisks task



commit 0381b3865c63d079819067a2979f48b72909c9a5
Author: Colin Walters <walters verbum org>
Date:   Thu Nov 21 16:13:55 2013 -0500

    Fix buildName for builddisks task
    
    Actually nothing else was really reading this._buildName, and what we
    were putting there was broken for both the 'local' case and the
    autobuilder case.

 src/js/task.js                  |    9 ++++++++-
 src/js/tasks/task-builddisks.js |    2 ++
 2 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/src/js/task.js b/src/js/task.js
index fe6ec1d..2c34e6f 100644
--- a/src/js/task.js
+++ b/src/js/task.js
@@ -345,7 +345,14 @@ const Task = new Lang.Class({
         this.builddir = Gio.File.new_for_path(GLib.getenv('_OSTBUILD_BUILDDIR'));
 
        let relpath = this.workdir.get_relative_path(this.builddir);
-       this._buildName = VersionedDir.relpathToVersion(relpath);
+       if (relpath == 'local') {
+           this._buildName = 'local';
+       } else if (relpath.indexOf('builds/') == 0) {
+           relpath = relpath.substring(7);
+           this._buildName = VersionedDir.relpathToVersion(relpath);
+       } else {
+           throw new Error();
+       }
 
        this.mirrordir = this.workdir.get_child('src');
        GSystem.file_ensure_directory(this.mirrordir, true, null);
diff --git a/src/js/tasks/task-builddisks.js b/src/js/tasks/task-builddisks.js
index ebf9e9b..37d0f1f 100644
--- a/src/js/tasks/task-builddisks.js
+++ b/src/js/tasks/task-builddisks.js
@@ -62,6 +62,8 @@ const TaskBuildDisks = new Lang.Class({
             return;
         }
 
+        print("Creating image for buildName=" + this._buildName);
+
         let buildDataPath = this.builddir.get_child('build.json');
         let buildData = JsonUtil.loadJson(buildDataPath, cancellable);
 


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