bitbake-1.4/lib/bb/cache.py:
authorHolger Hans Peter Freyther <zecke@selfish.org>
Sat, 29 Apr 2006 17:37:44 +0000 (17:37 +0000)
committerHolger Hans Peter Freyther <zecke@selfish.org>
Sat, 29 Apr 2006 17:37:44 +0000 (17:37 +0000)
bitbake-1.4/lib/bb/parse/__init__.py:
    Attachment http://bugs.openembedded.org/attachment.cgi?id=679
    from #918 from bug #918 to work with spaces in filenames properly.

    This changed the type of __depends and we need to update the
    cache version due this.

lib/bb/cache.py
lib/bb/parse/__init__.py

index d4be9d7..e3e0d6a 100644 (file)
@@ -40,7 +40,8 @@ except ImportError:
     import pickle
     print "NOTE: Importing cPickle failed. Falling back to a very slow implementation."
 
-__cache_version__ = "123"
+# __cache_version__ = "123"
+__cache_version__ = "124" # changes the __depends structure
 
 class Cache:
     """
@@ -192,16 +193,12 @@ class Cache:
 
         # Check dependencies are still valid
         depends = self.getVar("__depends", fn, True)
-        if depends:
-            deps = depends.split(" ")
-            for dep in deps:
-                (f,old_mtime_s) = dep.split("@")
-                old_mtime = int(old_mtime_s)
-                new_mtime = bb.parse.cached_mtime(f)
-                if (new_mtime > old_mtime):
-                    bb.debug(2, "Cache: %s's dependency %s changed" % (fn, f))
-                    self.remove(fn)
-                    return False
+        for f,old_mtime in depends:
+            new_mtime = bb.parse.cached_mtime(f)
+            if (new_mtime > old_mtime):
+                bb.debug(2, "Cache: %s's dependency %s changed" % (fn, f))
+                self.remove(fn)
+                return False
 
         bb.debug(2, "Depends Cache: %s is clean" % fn)
         if not fn in self.clean:
index cb27416..58e17d1 100644 (file)
@@ -46,9 +46,9 @@ def update_mtime(f):
 def mark_dependency(d, f):
     if f.startswith('./'):
         f = "%s/%s" % (os.getcwd(), f[2:])
-    deps = (bb.data.getVar('__depends', d) or "").split()
-    deps.append("%s@%s" % (f, cached_mtime(f)))
-    bb.data.setVar('__depends', " ".join(deps), d)
+    deps = bb.data.getVar('__depends', d) or []
+    deps.append( (f, cached_mtime(f)) )
+    bb.data.setVar('__depends', deps, d)
 
 def supports(fn, data):
     """Returns true if we have a handler for this file, false otherwise"""