[gnome-ostree] autobuilder: Look up latest snapshot in queueResolve



commit 19f11d3b83ecdf657419c005a70ffa6a493a225d
Author: Colin Walters <walters verbum org>
Date:   Wed Feb 27 12:47:35 2013 -0500

    autobuilder: Look up latest snapshot in queueResolve
    
    Otherwise we crash trying to find some arbitrary old version.  This
    broke when we reworked the autobuilder's task stuff.

 src/js/builtins/autobuilder.js |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/src/js/builtins/autobuilder.js b/src/js/builtins/autobuilder.js
index 4230572..8097b75 100644
--- a/src/js/builtins/autobuilder.js
+++ b/src/js/builtins/autobuilder.js
@@ -54,7 +54,6 @@ const Autobuilder = new Lang.Class({
        this._initialResolveNeeded = true;
        this._fullResolveNeeded = true;
        this._resolveTimeout = 0;
-       this._sourceSnapshotPath = null;
        this._prevSourceSnapshotPath = null;
        this._queuedForceResolve = [];
     },
@@ -81,8 +80,6 @@ const Autobuilder = new Lang.Class({
        this._taskmaster.connect('task-executing', Lang.bind(this, this._onTaskExecuting));
        this._taskmaster.connect('task-complete', Lang.bind(this, this._onTaskCompleted));
 
-       this._sourceSnapshotPath = this._src_db.getLatestPath();
-
        /* Start an initial, non-fetching resolve */
        this._runResolve();
        /* Flag immediately that we need a full resolve */
@@ -139,8 +136,9 @@ const Autobuilder = new Lang.Class({
 
     queueResolve: function(srcUrls) {
        let matchingComponents = [];
-       let snapshotData = this._src_db.loadFromPath(this._sourceSnapshotPath, null);
-       let snapshot = new Snapshot.Snapshot(snapshotData, this._sourceSnapshotPath);
+       let latestPath = this._src_db.getLatestPath();
+       let snapshotData = this._src_db.loadFromPath(latestPath, null);
+       let snapshot = new Snapshot.Snapshot(snapshotData, latestPath);
        for (let i = 0; i < srcUrls.length; i++) {
            let matches = snapshot.getMatchingSrc(srcUrls[i]);
            for (let j = 0; j < matches.length; j++) {


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