aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/bb/cache.py9
-rw-r--r--lib/bb/siggen.py6
2 files changed, 15 insertions, 0 deletions
diff --git a/lib/bb/cache.py b/lib/bb/cache.py
index 92e9a3ced..988c596c3 100644
--- a/lib/bb/cache.py
+++ b/lib/bb/cache.py
@@ -24,6 +24,7 @@ from collections.abc import Mapping
import bb.utils
from bb import PrefixLoggerAdapter
import re
+import shutil
logger = logging.getLogger("BitBake.Cache")
@@ -998,3 +999,11 @@ class SimpleCache(object):
p.dump([data, self.cacheversion])
bb.utils.unlockfile(glf)
+
+ def copyfile(self, target):
+ if not self.cachefile:
+ return
+
+ glf = bb.utils.lockfile(self.cachefile + ".lock")
+ shutil.copy(self.cachefile, target)
+ bb.utils.unlockfile(glf)
diff --git a/lib/bb/siggen.py b/lib/bb/siggen.py
index 08eca7860..3f3d6df54 100644
--- a/lib/bb/siggen.py
+++ b/lib/bb/siggen.py
@@ -120,6 +120,9 @@ class SignatureGenerator(object):
def save_unitaskhashes(self):
return
+ def copy_unitaskhashes(self, targetdir):
+ return
+
def set_setscene_tasks(self, setscene_tasks):
return
@@ -358,6 +361,9 @@ class SignatureGeneratorBasic(SignatureGenerator):
def save_unitaskhashes(self):
self.unihash_cache.save(self.unitaskhashes)
+ def copy_unitaskhashes(self, targetdir):
+ self.unihash_cache.copyfile(targetdir)
+
def dump_sigtask(self, fn, task, stampbase, runtime):
tid = fn + ":" + task