[gnome-ostree/wip/dyntask-2: 1/2] build: Always do a build if we have local components



commit 24038a9164b3fa40540f6c7e7e2f2e47b03d9ade
Author: Colin Walters <walters verbum org>
Date:   Tue Jan 29 16:13:09 2013 -0500

    build: Always do a build if we have local components

 src/ostbuild/js/builtins/build.js |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/src/ostbuild/js/builtins/build.js b/src/ostbuild/js/builtins/build.js
index bc2dcb1..d86d1ad 100644
--- a/src/ostbuild/js/builtins/build.js
+++ b/src/ostbuild/js/builtins/build.js
@@ -654,16 +654,25 @@ const Build = new Lang.Class({
 	this._initSnapshot(args.prefix, args.snapshot, cancellable);
 	this.args = args;
 
+        let components = this._snapshot.data['components'];
+
 	let buildresultDir = this.workdir.get_child('builds').get_child(this.prefix);
 	let builddb = new JsonDB.JsonDB(buildresultDir);
 
 	let targetSourceVersion = builddb.parseVersionStr(this._snapshot.path.get_basename())
 
+	let haveLocalComponent = false;
+        for (let i = 0; i < components.length; i++) {
+	    let component = components[i];
+	    if (component['src'].indexOf('local:') == 0)
+		haveLocalComponent = true;
+	}
+
 	let latestBuildPath = builddb.getLatestPath();
 	if (latestBuildPath != null) {
 	    let lastBuiltSourceData = builddb.loadFromPath(latestBuildPath, cancellable);
 	    let lastBuiltSourceVersion = builddb.parseVersionStr(lastBuiltSourceData['snapshotName']);
-	    if (lastBuiltSourceVersion == targetSourceVersion) {
+	    if (!haveLocalComponent && lastBuiltSourceVersion == targetSourceVersion) {
 		print("Already built source snapshot " + lastBuiltSourceVersion);
 		return;
 	    } else {
@@ -680,8 +689,6 @@ const Build = new Lang.Class({
 			     cancellable);
 	}
 
-        let components = this._snapshot.data['components'];
-
         let prefix = this._snapshot.data['prefix'];
         let basePrefix = this._snapshot.data['base']['name'] + '/' + prefix;
         let architectures = this._snapshot.data['architectures'];



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