diff options
author | Michael 'Mickey' Lauer <mickey@vanille-media.de> | 2005-09-08 13:11:53 +0000 |
---|---|---|
committer | Michael 'Mickey' Lauer <mickey@vanille-media.de> | 2005-09-08 13:11:53 +0000 |
commit | 6a5f647e83145ab6d470469974c618511b458827 (patch) | |
tree | 26714b93e571c271bcfa2fc72679791a47d81be9 /lib/bb/parse/__init__.py | |
parent | 3d7348c9eb7deebecce594f005f0019f9139e51c (diff) | |
download | bitbake-contrib-6a5f647e83145ab6d470469974c618511b458827.tar.gz |
parser: add function to update the mtime for one file, courtesy Justin Patrin
parser: move import bb and import os out of the commands (import in a function that's called often has a performance penalty)
lib: increase revision
shell: add 'reparse' and 'fileReparse' commands, courtesy Justin Patrin
Diffstat (limited to 'lib/bb/parse/__init__.py')
-rw-r--r-- | lib/bb/parse/__init__.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/bb/parse/__init__.py b/lib/bb/parse/__init__.py index b8839c09f..cb2741606 100644 --- a/lib/bb/parse/__init__.py +++ b/lib/bb/parse/__init__.py @@ -26,6 +26,8 @@ __all__ = [ 'ParseError', 'SkipPackage', 'cached_mtime', 'mark_dependency', 'supports', 'handle', 'init' ] handlers = [] +import bb, os + class ParseError(Exception): """Exception raised when parsing fails""" @@ -34,13 +36,14 @@ class SkipPackage(Exception): __mtime_cache = {} def cached_mtime(f): - import os if not __mtime_cache.has_key(f): - __mtime_cache[f] = os.stat(f)[8] + update_mtime(f) return __mtime_cache[f] +def update_mtime(f): + __mtime_cache[f] = os.stat(f)[8] + def mark_dependency(d, f): - import bb, os if f.startswith('./'): f = "%s/%s" % (os.getcwd(), f[2:]) deps = (bb.data.getVar('__depends', d) or "").split() |