[gnome-continuous/wip/hwtest: 4/11] task-builddisks: allows restricting to particular specific targets



commit 3eab981583795e43794200b38c8ca9c0e1410d21
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Thu Jun 5 09:39:11 2014 -0400

    task-builddisks: allows restricting to particular specific targets

 src/js/tasks/task-builddisks.js |   19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)
---
diff --git a/src/js/tasks/task-builddisks.js b/src/js/tasks/task-builddisks.js
index 94c4b0b..ad7d408 100644
--- a/src/js/tasks/task-builddisks.js
+++ b/src/js/tasks/task-builddisks.js
@@ -48,6 +48,8 @@ const TaskBuildDisks = new Lang.Class({
     _inheritPreviousDisk: true,
     _onlyTreeSuffixes: ['-runtime', '-devel-debug'],
 
+    DefaultParameters: {targets: null},
+
     execute: function(cancellable) {
         let isLocal = this._buildName == 'local';
              let baseImageDir = this.workdir.resolve_relative_path(this._imageSubdir);
@@ -80,10 +82,19 @@ const TaskBuildDisks = new Lang.Class({
 
         for (let targetName in targets) {
             let matched = false;
-            for (let i = 0; i < this._onlyTreeSuffixes.length; i++) {
-                if (JSUtil.stringEndswith(targetName, this._onlyTreeSuffixes[i])) {
-                    matched = true;
-                    break;
+            if (this.parameters.targets !== null) {
+                for (let i = 0; i < this.parameters.targets.length; i++) {
+                    if (JSUtil.stringEndswith(targetName, '/' + this.parameters.targets[i])) {
+                        matched = true;
+                        break;
+                    }
+                }
+            } else {
+                for (let i = 0; i < this._onlyTreeSuffixes.length; i++) {
+                    if (JSUtil.stringEndswith(targetName, this._onlyTreeSuffixes[i])) {
+                        matched = true;
+                        break;
+                    }
                 }
             }
             if (!matched)


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