summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bitbake/lib/bb/build.py17
-rw-r--r--bitbake/lib/bb/cooker.py3
2 files changed, 18 insertions, 2 deletions
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py
index 65cc851df4..0f6aa1a14c 100644
--- a/bitbake/lib/bb/build.py
+++ b/bitbake/lib/bb/build.py
@@ -31,6 +31,7 @@ import logging
31import shlex 31import shlex
32import glob 32import glob
33import time 33import time
34import stat
34import bb 35import bb
35import bb.msg 36import bb.msg
36import bb.process 37import bb.process
@@ -42,6 +43,20 @@ logger = logging.getLogger('BitBake.Build')
42 43
43NULL = open(os.devnull, 'r+') 44NULL = open(os.devnull, 'r+')
44 45
46__mtime_cache = {}
47
48def cached_mtime_noerror(f):
49 if f not in __mtime_cache:
50 try:
51 __mtime_cache[f] = os.stat(f)[stat.ST_MTIME]
52 except OSError:
53 return 0
54 return __mtime_cache[f]
55
56def reset_cache():
57 global __mtime_cache
58 __mtime_cache = {}
59
45# When we execute a Python function, we'd like certain things 60# When we execute a Python function, we'd like certain things
46# in all namespaces, hence we add them to __builtins__. 61# in all namespaces, hence we add them to __builtins__.
47# If we do not do this and use the exec globals, they will 62# If we do not do this and use the exec globals, they will
@@ -535,7 +550,7 @@ def stamp_internal(taskname, d, file_name, baseonly=False):
535 stamp = bb.parse.siggen.stampfile(stamp, file_name, taskname, extrainfo) 550 stamp = bb.parse.siggen.stampfile(stamp, file_name, taskname, extrainfo)
536 551
537 stampdir = os.path.dirname(stamp) 552 stampdir = os.path.dirname(stamp)
538 if bb.parse.cached_mtime_noerror(stampdir) == 0: 553 if cached_mtime_noerror(stampdir) == 0:
539 bb.utils.mkdirhier(stampdir) 554 bb.utils.mkdirhier(stampdir)
540 555
541 return stamp 556 return stamp
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 9c101f2e72..ddf5fedb83 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -35,7 +35,7 @@ from contextlib import closing
35from functools import wraps 35from functools import wraps
36from collections import defaultdict 36from collections import defaultdict
37import bb, bb.exceptions, bb.command 37import bb, bb.exceptions, bb.command
38from bb import utils, data, parse, event, cache, providers, taskdata, runqueue 38from bb import utils, data, parse, event, cache, providers, taskdata, runqueue, build
39import Queue 39import Queue
40import signal 40import signal
41import prserv.serv 41import prserv.serv
@@ -1343,6 +1343,7 @@ class BBCooker:
1343 return True 1343 return True
1344 return retval 1344 return retval
1345 1345
1346 build.reset_cache()
1346 self.buildSetVars() 1347 self.buildSetVars()
1347 1348
1348 taskdata, runlist, fulltargetlist = self.buildTaskData(targets, task, self.configuration.abort) 1349 taskdata, runlist, fulltargetlist = self.buildTaskData(targets, task, self.configuration.abort)