[gnome-ostree] build: Write out to status file which component failed
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-ostree] build: Write out to status file which component failed
- Date: Mon, 19 Aug 2013 18:49:26 +0000 (UTC)
commit c4a04508168de3053992b0c7ae0f292b9deef0f4
Author: Colin Walters <walters verbum org>
Date: Mon Aug 19 14:21:09 2013 -0400
build: Write out to status file which component failed
And while we're here, create a helper function (this should really go
in task.js probably).
src/js/tasks/task-build.js | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/js/tasks/task-build.js b/src/js/tasks/task-build.js
index bb0fc63..4a18b4f 100644
--- a/src/js/tasks/task-build.js
+++ b/src/js/tasks/task-build.js
@@ -657,6 +657,7 @@ const TaskBuild = new Lang.Class({
try {
proc.wait_sync_check(cancellable);
} catch (e) {
+ this._writeStatus('failed: ' + basename, cancellable);
print("Build of " + basename + " failed");
throw e;
}
@@ -1149,6 +1150,13 @@ const TaskBuild = new Lang.Class({
throw new Error("Failed to find target " + name);
},
+ _writeStatus: function(text, cancellable) {
+ let statusTxtPath = Gio.File.new_for_path('status.txt');
+ statusTxtPath.replace_contents(text + '\n', null, false,
+ Gio.FileCreateFlags.REPLACE_DESTINATION,
+ cancellable);
+ },
+
execute: function(cancellable) {
this._linuxUserChrootPath = BuildUtil.findUserChrootPath();
@@ -1562,9 +1570,7 @@ const TaskBuild = new Lang.Class({
if (composeTreeTaskError)
throw new Error(composeTreeTaskError);
- let statusTxtPath = Gio.File.new_for_path('status.txt');
- statusTxtPath.replace_contents('built: ' + this._rebuiltComponents.join(' ') + '\n', null, false,
- Gio.FileCreateFlags.REPLACE_DESTINATION, cancellable);
+ this._writeStatus('built: ' + this._rebuiltComponents.join(' '), cancellable);
let [path, modified] = builddb.store(buildData, cancellable);
print("Build complete: " + path.get_path());
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]