[gnome-ostree/wip/gjs-round2] ostbuild: log() -> print()



commit f9074f3f8187e65302b19cca2a3617d5a310088d
Author: Colin Walters <walters verbum org>
Date:   Wed Dec 12 17:36:52 2012 -0500

    ostbuild: log() -> print()
    
    Since log() doesn't do anything by default, which is not what we
    want...

 src/ostbuild/js/autobuilder.js |   14 +++++++-------
 src/ostbuild/js/build.js       |   22 +++++++++++-----------
 src/ostbuild/js/checkout.js    |    4 ++--
 src/ostbuild/js/git_mirror.js  |    2 +-
 src/ostbuild/js/resolve.js     |    4 ++--
 src/ostbuild/js/vcs.js         |    4 ++--
 6 files changed, 25 insertions(+), 25 deletions(-)
---
diff --git a/src/ostbuild/js/autobuilder.js b/src/ostbuild/js/autobuilder.js
index 239d6fb..822950b 100644
--- a/src/ostbuild/js/autobuilder.js
+++ b/src/ostbuild/js/autobuilder.js
@@ -95,14 +95,14 @@ const AutoBuilder = new Lang.Class({
     queueBuild: function(components) {
 	this._queued_force_builds.push.apply(this._queued_force_builds, components);
 	this._build_needed = true;
-	log("queued builds: " + this._queued_force_builds);
+	print("queued builds: " + this._queued_force_builds);
 	if (this._build_proc == null)
 	    this._run_build();
     },
 
     queueResolve: function(components) {
 	this._queued_force_resolve.push.apply(this._queued_force_resolve, components);
-	log("queued resolves: " + this._queued_force_resolve);
+	print("queued resolves: " + this._queued_force_resolve);
 	if (this._resolve_proc == null)
 	    this._fetch();
     },
@@ -133,7 +133,7 @@ const AutoBuilder = new Lang.Class({
 	context.set_stderr_disposition(GSystem.SubprocessStreamDisposition.STDERR_MERGE);
 	this._resolve_proc = new GSystem.Subprocess({context: context});
 	this._resolve_proc.init(null);
-	log(Format.vprintf("Resolve task %s.%s started, pid=%s", [t.major, t.minor, this._resolve_proc.get_pid()]));
+	print(Format.vprintf("Resolve task %s.%s started, pid=%s", [t.major, t.minor, this._resolve_proc.get_pid()]));
 	this._resolve_proc.wait(null, Lang.bind(this, this._onResolveExited));
 
 	this._updateStatus();
@@ -144,7 +144,7 @@ const AutoBuilder = new Lang.Class({
     _onResolveExited: function(process, result) {
 	this._resolve_proc = null;
 	let [success, msg] = ProcUtil.asyncWaitCheckFinish(process, result);
-	log(Format.vprintf("resolve exited; success=%s msg=%s", [success, msg]))
+	print(Format.vprintf("resolve exited; success=%s msg=%s", [success, msg]))
 	this._resolve_taskset.finish(success);
 	this._prev_source_snapshot_path = this._source_snapshot_path;
 	this._source_snapshot_path = this._src_db.getLatestPath();
@@ -155,7 +155,7 @@ const AutoBuilder = new Lang.Class({
 	let changed = (this._prev_source_snapshot_path == null ||
 		       !this._prev_source_snapshot_path.equal(this._source_snapshot_path));
         if (changed)
-            log(Format.vprintf("New version is %s", [this._source_snapshot_path.get_path()]))
+            print(Format.vprintf("New version is %s", [this._source_snapshot_path.get_path()]))
 	if (!this._build_needed)
 	    this._build_needed = changed;
 	if (this._build_needed && this._build_proc == null)
@@ -194,7 +194,7 @@ const AutoBuilder = new Lang.Class({
 	context.set_stderr_disposition(GSystem.SubprocessStreamDisposition.STDERR_MERGE);
 	this._build_proc = new GSystem.Subprocess({context: context});
 	this._build_proc.init(null);
-	log(Format.vprintf("Build task %s.%s started, pid=%s", [task.major, task.minor, this._build_proc.get_pid()]));
+	print(Format.vprintf("Build task %s.%s started, pid=%s", [task.major, task.minor, this._build_proc.get_pid()]));
 	this._build_proc.wait(null, Lang.bind(this, this._onBuildExited));
 
 	this._updateStatus();
@@ -204,7 +204,7 @@ const AutoBuilder = new Lang.Class({
 	if (this._build_proc == null) throw new Error();
 	this._build_proc = null;
 	let [success, msg] = ProcUtil.asyncWaitCheckFinish(process, result);
-	log(Format.vprintf("build exited; success=%s msg=%s", [success, msg]))
+	print(Format.vprintf("build exited; success=%s msg=%s", [success, msg]))
 	this._build_taskset.finish(success);
 	if (this._build_needed)
 	    this._run_build()
diff --git a/src/ostbuild/js/build.js b/src/ostbuild/js/build.js
index 54b89d5..57cfeec 100644
--- a/src/ostbuild/js/build.js
+++ b/src/ostbuild/js/build.js
@@ -63,7 +63,7 @@ const Build = new Lang.Class({
             if (path.equal(keepRoot)) {
                 continue;
 	    }
-            log("Removing old cached buildroot " + path.get_path());
+            print("Removing old cached buildroot " + path.get_path());
             GSystem.shutil_rm_rf(path, cancellable);
 	}
     },
@@ -93,7 +93,7 @@ const Build = new Lang.Class({
 									prefix,
 									architecture]);
 
-        log("Computing buildroot contents");
+        print("Computing buildroot contents");
 
         let archBuildrootRev = ProcUtil.runSyncGetOutputUTF8Stripped(['ostree', '--repo=' + this.repo.get_path(), 'rev-parse',
 								      archBuildrootName], cancellable);
@@ -142,14 +142,14 @@ const Build = new Lang.Class({
 
         let cachedRoot = buildrootCachedir.get_child(newRootCacheid);
         if (cachedRoot.query_exists(cancellable)) {
-            log("Reusing cached buildroot: " + cachedRoot.get_path());
+            print("Reusing cached buildroot: " + cachedRoot.get_path());
             this._cleanStaleBuildroots(buildrootCachedir, cachedRoot, cancellable);
             GSystem.file_unlink(tmpPath, cancellable);
             return cachedRoot;
 	}
 
         if (checkoutTrees.length > 0) {
-            log("composing buildroot from %d parents (last: %s)" % (checkoutTrees.length,
+            print("composing buildroot from %d parents (last: %s)" % (checkoutTrees.length,
                                                                     checkoutTrees[checkoutTrees.length-1][0]));
 	}
 
@@ -172,7 +172,7 @@ const Build = new Lang.Class({
         this._cleanStaleBuildroots(buildrootCachedir, cachedRoot, cancellable);
 
         let endtime = GLib.DateTime.new_now_utc();
-        log(Format.vprintf("Composed buildroot; %d seconds elapsed", [endtime.difference(starttime) / GLib.USEC_PER_SEC]));
+        print(Format.vprintf("Composed buildroot; %d seconds elapsed", [endtime.difference(starttime) / GLib.USEC_PER_SEC]));
         return cachedRoot;
      },
 
@@ -195,7 +195,7 @@ const Build = new Lang.Class({
 	    ProcUtil.runSync(args, cancellable, {cwd: componentSrcdir,
 						 env: env});
         } else {
-            log("No previous build; skipping source diff");
+            print("No previous build; skipping source diff");
 	}
      },
 
@@ -310,7 +310,7 @@ const Build = new Lang.Class({
 	    previousMetadata = JSON.parse(jsonstr);
             previousVcsVersion = previousMetadata['revision'];
         } else {
-            log("No previous build for " + buildname);
+            print("No previous build for " + buildname);
             previousVcsVersion = null;
 	}
 
@@ -350,16 +350,16 @@ const Build = new Lang.Class({
             let rebuildReason = this._needsRebuild(previousMetadata, expandedComponent);
             if (rebuildReason == null) {
                 if (!forceRebuild) {
-                    log(Format.vprintf("Reusing cached build of %s at %s", [buildname, previousVcsVersion]));
+                    print(Format.vprintf("Reusing cached build of %s at %s", [buildname, previousVcsVersion]));
                     if (!wasInBuildCache) {
                         return this._saveComponentBuild(buildname, expandedComponent, cancellable);
 		    }
                     return previousBuildVersion;
                 } else {
-                    log("Build forced regardless");
+                    print("Build forced regardless");
 		}
             } else {
-                log(Format.vprintf("Need rebuild of %s: %s", [buildname, rebuildReason]));
+                print(Format.vprintf("Need rebuild of %s: %s", [buildname, rebuildReason]));
 	    }
 	}
 
@@ -751,7 +751,7 @@ const Build = new Lang.Class({
 
         for (let i = 0; i < targetsList.length; i++) {
 	    let target = targetsList[i];
-            log(Format.vprintf("Composing %s from %d components", [target['name'], target['contents'].length]));
+            print(Format.vprintf("Composing %s from %d components", [target['name'], target['contents'].length]));
             this._composeOneTarget(target, componentBuildRevs, cancellable);
 	}
     }
diff --git a/src/ostbuild/js/checkout.js b/src/ostbuild/js/checkout.js
index 291ed4a..69fafc7 100644
--- a/src/ostbuild/js/checkout.js
+++ b/src/ostbuild/js/checkout.js
@@ -90,7 +90,7 @@ const Checkout = new Lang.Class({
 
         if (args.clean) {
             if (isLocal) {
-                log("note: ignoring --clean argument due to \"local:\" specification");
+                print("note: ignoring --clean argument due to \"local:\" specification");
             } else {
                 Vcs.clean(keytype, checkoutdir, cancellable);
 	    }
@@ -114,7 +114,7 @@ const Checkout = new Lang.Class({
         let metadataPath = checkoutdir.get_child('_ostbuild-meta.json');
 	JsonUtil.writeJsonFileAtomic(metadataPath, component, cancellable);
         
-        log("Checked out: " + checkoutdir.get_path());
+        print("Checked out: " + checkoutdir.get_path());
     }
 });
 
diff --git a/src/ostbuild/js/git_mirror.js b/src/ostbuild/js/git_mirror.js
index adeee0f..2c445af 100644
--- a/src/ostbuild/js/git_mirror.js
+++ b/src/ostbuild/js/git_mirror.js
@@ -94,7 +94,7 @@ const GitMirror = new Lang.Class({
             if (!args.fetch) {
                 Vcs.ensureVcsMirror(this._mirrordir, keytype, uri, branchOrTag, cancellable);
 	    } else {
-		log("Running git fetch for " + name);
+		print("Running git fetch for " + name);
 		Vcs.fetch(this._mirrordir, keytype, uri, branchOrTag, cancellable, {keepGoing:args.keep_going});
 	    }
 	}));
diff --git a/src/ostbuild/js/resolve.js b/src/ostbuild/js/resolve.js
index 4d93f85..2ae890d 100644
--- a/src/ostbuild/js/resolve.js
+++ b/src/ostbuild/js/resolve.js
@@ -135,9 +135,9 @@ const Resolve = new Lang.Class({
 	this._src_db = new JsonDB.JsonDB(snapshotdir, this.prefix + '-src-snapshot');
         let [path, modified] = this._src_db.store(this._snapshot, cancellable);
         if (modified) {
-            log("New source snapshot: " + path.get_path());
+            print("New source snapshot: " + path.get_path());
         } else {
-            log("Source snapshot unchanged: " + path.get_path());
+            print("Source snapshot unchanged: " + path.get_path());
 	}
     }
 });
diff --git a/src/ostbuild/js/vcs.js b/src/ostbuild/js/vcs.js
index 5c62b15..1f1dfee 100644
--- a/src/ostbuild/js/vcs.js
+++ b/src/ostbuild/js/vcs.js
@@ -196,10 +196,10 @@ function ensureVcsMirror(mirrordir, keytype, uri, branch, cancellable,
 
     let changed = currentVcsVersion != lastFetchContents; 
     if (changed) {
-        log(Format.vprintf("last fetch %s differs from branch %s", [lastFetchContents, currentVcsVersion]));
+        print(Format.vprintf("last fetch %s differs from branch %s", [lastFetchContents, currentVcsVersion]));
 	_listSubmodules(mirrordir, mirror, keytype, uri, branch, cancellable).forEach(function (elt) {
 	    let [subChecksum, subName, subUrl] = elt;
-	    log("Processing submodule " + subName + " at " + subChecksum + " from " + subUrl);
+	    print("Processing submodule " + subName + " at " + subChecksum + " from " + subUrl);
             ensureVcsMirror(mirrordir, keytype, subUrl, subChecksum, cancellable, {fetch:fetch});
 	});
     }



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