summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/parse
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2011-01-03 20:57:19 +0100
committerRichard Purdie <rpurdie@linux.intel.com>2011-01-04 15:00:07 +0000
commit9ed8e9f37136ee170433effad0ebd4130dc97007 (patch)
tree1f41f8a73592fbbaaedc318e8ffd30b7750caf7d /bitbake/lib/bb/parse
parent0090a798eb868ebc926944eac2e6d4a5aff3e1b3 (diff)
downloadpoky-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/lib/bb/parse')
-rw-r--r--bitbake/lib/bb/parse/__init__.py7
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.
27handlers = [] 27handlers = []
28 28
29import os 29import os
30import stat
30import logging 31import logging
31import bb 32import bb
32import bb.utils 33import bb.utils
@@ -43,19 +44,19 @@ class SkipPackage(Exception):
43__mtime_cache = {} 44__mtime_cache = {}
44def cached_mtime(f): 45def 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
49def cached_mtime_noerror(f): 50def 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
57def update_mtime(f): 58def 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
61def mark_dependency(d, f): 62def mark_dependency(d, f):