diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2011-01-03 20:57:19 +0100 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2011-01-04 15:00:07 +0000 |
commit | 9ed8e9f37136ee170433effad0ebd4130dc97007 (patch) | |
tree | 1f41f8a73592fbbaaedc318e8ffd30b7750caf7d /bitbake | |
parent | 0090a798eb868ebc926944eac2e6d4a5aff3e1b3 (diff) | |
download | poky-9ed8e9f37136ee170433effad0ebd4130dc97007.tar.gz |
parse: Use constants from stat instead of magic numbers
(Bitbake rev: bcabe2dfb587042e139890329ff52d9bb9201cf4)
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/parse/__init__.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bitbake/lib/bb/parse/__init__.py b/bitbake/lib/bb/parse/__init__.py index 7f1562e66e..eee8d9cddb 100644 --- a/bitbake/lib/bb/parse/__init__.py +++ b/bitbake/lib/bb/parse/__init__.py | |||
@@ -27,6 +27,7 @@ File parsers for the BitBake build tools. | |||
27 | handlers = [] | 27 | handlers = [] |
28 | 28 | ||
29 | import os | 29 | import os |
30 | import stat | ||
30 | import logging | 31 | import logging |
31 | import bb | 32 | import bb |
32 | import bb.utils | 33 | import bb.utils |
@@ -43,19 +44,19 @@ class SkipPackage(Exception): | |||
43 | __mtime_cache = {} | 44 | __mtime_cache = {} |
44 | def cached_mtime(f): | 45 | def cached_mtime(f): |
45 | if f not in __mtime_cache: | 46 | if f not in __mtime_cache: |
46 | __mtime_cache[f] = os.stat(f)[8] | 47 | __mtime_cache[f] = os.stat(f)[stat.ST_MTIME] |
47 | return __mtime_cache[f] | 48 | return __mtime_cache[f] |
48 | 49 | ||
49 | def cached_mtime_noerror(f): | 50 | def cached_mtime_noerror(f): |
50 | if f not in __mtime_cache: | 51 | if f not in __mtime_cache: |
51 | try: | 52 | try: |
52 | __mtime_cache[f] = os.stat(f)[8] | 53 | __mtime_cache[f] = os.stat(f)[stat.ST_MTIME] |
53 | except OSError: | 54 | except OSError: |
54 | return 0 | 55 | return 0 |
55 | return __mtime_cache[f] | 56 | return __mtime_cache[f] |
56 | 57 | ||
57 | def update_mtime(f): | 58 | def update_mtime(f): |
58 | __mtime_cache[f] = os.stat(f)[8] | 59 | __mtime_cache[f] = os.stat(f)[stat.ST_MTIME] |
59 | return __mtime_cache[f] | 60 | return __mtime_cache[f] |
60 | 61 | ||
61 | def mark_dependency(d, f): | 62 | def mark_dependency(d, f): |