[gnome-ostree] build: Add a "build-epoch" system that triggers rebuilds



commit 49fa2dfe227162b408887d0c63d208f943a6beba
Author: Colin Walters <walters verbum org>
Date:   Mon Jan 21 18:46:02 2013 -0500

    build: Add a "build-epoch" system that triggers rebuilds
    
    The xorg-server ABI was just bumped, so the modules fail to load.  We
    need a mechanism to simply force a rebuild of the modules, even though
    they didn't change.
    
    This is an implementation of such a mechanism.  The primary advantage
    of doing it this way is that the sole input to the build system
    remains git repositories - there's no need for a separate out of band
    signalling mechanism with a different authentication system, etc.
    
    The downside is that the rebuild epoch is kind of conceptually tied to
    one build server.  So in theory it should probably be a git repository
    tied to a builder.

 manifest.json                     |   11 ++++++++++-
 src/ostbuild/js/builtins/build.js |   17 +++++++++++++++++
 2 files changed, 27 insertions(+), 1 deletions(-)
---
diff --git a/manifest.json b/manifest.json
index cc1f97f..c71b2e3 100644
--- a/manifest.json
+++ b/manifest.json
@@ -778,5 +778,14 @@
 
 		{"src": "gnome:caribou"}
 
-	]
+	],
+    
+    "build-epoch": {"version": 0,
+		    "component-names": ["xorg-driver-xf86-input-evdev",
+					"xorg-driver-xf86-input-keyboard",
+					"xorg-driver-xf86-input-mouse", 
+					"xorg-driver-xf86-video-cirrus",
+					"xorg-driver-xf86-video-intel",
+					"xorg-driver-xf86-video-vesa"]}
+
 }
diff --git a/src/ostbuild/js/builtins/build.js b/src/ostbuild/js/builtins/build.js
index fa707ae..6a90f21 100644
--- a/src/ostbuild/js/builtins/build.js
+++ b/src/ostbuild/js/builtins/build.js
@@ -734,6 +734,23 @@ const Build = new Lang.Class({
             this._componentBuildCache = {};
 	}
 
+	let previousBuildEpoch = this._componentBuildCache['build-epoch'];
+	let currentBuildEpoch = this._snapshot.data['build-epoch'];
+	if (previousBuildEpoch === undefined ||
+	    (currentBuildEpoch !== undefined &&
+	     previousBuildEpoch['version'] < currentBuildEpoch['version'])) {
+	    let currentEpochVer = currentBuildEpoch['version'];
+	    let rebuilds = currentBuildEpoch['component-names'];
+	    for (let i = 0; i < rebuilds.length; i++) {
+		let component = this._snapshot.getComponent(rebuilds[i]);
+		let name = component['name'];
+		print("Component " + name + " build forced via epoch");
+		this.forceBuildComponents[name] = true;
+	    }
+	}
+
+	this._componentBuildCache['build-epoch'] = currentBuildEpoch;
+
         for (let i = 0; i < componentsToBuild.length; i++) {
 	    let [component, architecture] = componentsToBuild[i];
             let archname = component['name'] + '/' + architecture;



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