1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-31 00:39:46 +00:00

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>
This commit is contained in:
Bernhard Reutner-Fischer
2011-01-03 20:57:19 +01:00
committed by Richard Purdie
parent 0090a798eb
commit 9ed8e9f371
+4 -3
View File
@@ -27,6 +27,7 @@ File parsers for the BitBake build tools.
handlers = [] handlers = []
import os import os
import stat
import logging import logging
import bb import bb
import bb.utils import bb.utils
@@ -43,19 +44,19 @@ class SkipPackage(Exception):
__mtime_cache = {} __mtime_cache = {}
def cached_mtime(f): def cached_mtime(f):
if f not in __mtime_cache: if f not in __mtime_cache:
__mtime_cache[f] = os.stat(f)[8] __mtime_cache[f] = os.stat(f)[stat.ST_MTIME]
return __mtime_cache[f] return __mtime_cache[f]
def cached_mtime_noerror(f): def cached_mtime_noerror(f):
if f not in __mtime_cache: if f not in __mtime_cache:
try: try:
__mtime_cache[f] = os.stat(f)[8] __mtime_cache[f] = os.stat(f)[stat.ST_MTIME]
except OSError: except OSError:
return 0 return 0
return __mtime_cache[f] return __mtime_cache[f]
def update_mtime(f): def update_mtime(f):
__mtime_cache[f] = os.stat(f)[8] __mtime_cache[f] = os.stat(f)[stat.ST_MTIME]
return __mtime_cache[f] return __mtime_cache[f]
def mark_dependency(d, f): def mark_dependency(d, f):