diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2006-04-28 21:07:16 +0000 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2006-04-28 21:07:16 +0000 |
commit | 6d7d68d1c50d2d5abc09f00167310cd60fc58d8d (patch) | |
tree | 9a344b2bf47cea2858692ff026b84458d3a4408d | |
parent | cb6e46a7a2af3115d410b80bbf11c3a9de906503 (diff) | |
download | bitbake-6d7d68d1c50d2d5abc09f00167310cd60fc58d8d.tar.gz |
bitbake/lib/bb/parse/__init__.py:
Bug 895. __depends is a single string with "filename@time" the
string gets splitted by ' ' as it is assumed that
"filename@time filename2@time2" is true. Basicly on PPC/Darwin
we have "PowerPC Macintosh.conf" splitting by space leads to the
error observed by koen.
Resolution:
As we use __depends only as a list, save it as a list. This
avoids the int->str->int, and split, append, join operations.
bitbake/lib/bb/cache.py:
__depends is now a list, change the version of the cache and
simplify the method.
-rw-r--r-- | lib/bb/cache.py | 19 | ||||
-rw-r--r-- | lib/bb/parse/__init__.py | 6 |
2 files changed, 11 insertions, 14 deletions
diff --git a/lib/bb/cache.py b/lib/bb/cache.py index d4be9d7ff..e3e0d6a16 100644 --- a/lib/bb/cache.py +++ b/lib/bb/cache.py @@ -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: diff --git a/lib/bb/parse/__init__.py b/lib/bb/parse/__init__.py index cb2741606..58e17d154 100644 --- a/lib/bb/parse/__init__.py +++ b/lib/bb/parse/__init__.py @@ -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""" |