[gnome-ostree] snapshot.js: Correctly traverse components



commit 369cafa91db0bf9841b8b0efebd7c516d16de0dc
Author: Colin Walters <walters verbum org>
Date:   Fri Dec 7 10:57:02 2012 -0500

    snapshot.js: Correctly traverse components
    
    Fixes the build diff.

 src/ostbuild/js/jsondb.js   |    1 +
 src/ostbuild/js/snapshot.js |   11 +++++++----
 2 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/ostbuild/js/jsondb.js b/src/ostbuild/js/jsondb.js
index 4bdc386..79d8da4 100644
--- a/src/ostbuild/js/jsondb.js
+++ b/src/ostbuild/js/jsondb.js
@@ -1,5 +1,6 @@
 const GLib = imports.gi.GLib;
 const Gio = imports.gi.Gio;
+const Lang = imports.lang;
 const Format = imports.format;
 
 const JsonUtil = imports.jsonutil;
diff --git a/src/ostbuild/js/snapshot.js b/src/ostbuild/js/snapshot.js
index dc2216f..f24369c 100644
--- a/src/ostbuild/js/snapshot.js
+++ b/src/ostbuild/js/snapshot.js
@@ -18,8 +18,11 @@
 
 function _componentDict(snapshot) {
     let r = {};
-    for (let component in snapshot['components']) {
-        r[component['name']] = component;
+    let components = snapshot['components'];
+    for (let i = 0; i< components.length; i++) {
+	let component = components[i];
+	let name = component['name'];
+        r[name] = component;
     }
     let patches = snapshot['patches'];
     r[patches['name']] = patches;
@@ -37,8 +40,8 @@ function snapshotDiff(a, b) {
     let removed = [];
 
     for (let name in a_components) {
-        let c_a = a_components[name]
-        let c_b = b_components[name]
+        let c_a = a_components[name];
+        let c_b = b_components[name];
         if (c_b == undefined) {
             removed.push(name);
 	} else if (c_a['revision'] != c_b['revision']) {



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