import shlex
import glob
import time
+import stat
import bb
import bb.msg
import bb.process
NULL = open(os.devnull, 'r+')
+__mtime_cache = {}
+
+def cached_mtime_noerror(f):
+ if f not in __mtime_cache:
+ try:
+ __mtime_cache[f] = os.stat(f)[stat.ST_MTIME]
+ except OSError:
+ return 0
+ return __mtime_cache[f]
+
+def reset_cache():
+ global __mtime_cache
+ __mtime_cache = {}
+
# When we execute a Python function, we'd like certain things
# in all namespaces, hence we add them to __builtins__.
# If we do not do this and use the exec globals, they will
stamp = bb.parse.siggen.stampfile(stamp, file_name, taskname, extrainfo)
stampdir = os.path.dirname(stamp)
- if bb.parse.cached_mtime_noerror(stampdir) == 0:
+ if cached_mtime_noerror(stampdir) == 0:
bb.utils.mkdirhier(stampdir)
return stamp
from functools import wraps
from collections import defaultdict
import bb, bb.exceptions, bb.command
-from bb import utils, data, parse, event, cache, providers, taskdata, runqueue
+from bb import utils, data, parse, event, cache, providers, taskdata, runqueue, build
import Queue
import signal
import prserv.serv
return True
return retval
+ build.reset_cache()
self.buildSetVars()
taskdata, runlist, fulltargetlist = self.buildTaskData(targets, task, self.configuration.abort)