diff options
Diffstat (limited to 'bitbake/lib/bb/siggen.py')
| -rw-r--r-- | bitbake/lib/bb/siggen.py | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py index 912c92c8be..b503559305 100644 --- a/bitbake/lib/bb/siggen.py +++ b/bitbake/lib/bb/siggen.py | |||
| @@ -12,6 +12,7 @@ import bb.data | |||
| 12 | import difflib | 12 | import difflib |
| 13 | import simplediff | 13 | import simplediff |
| 14 | from bb.checksum import FileChecksumCache | 14 | from bb.checksum import FileChecksumCache |
| 15 | from bb import runqueue | ||
| 15 | 16 | ||
| 16 | logger = logging.getLogger('BitBake.SigGen') | 17 | logger = logging.getLogger('BitBake.SigGen') |
| 17 | 18 | ||
| @@ -473,10 +474,12 @@ class SignatureGeneratorUniHashMixIn(object): | |||
| 473 | 474 | ||
| 474 | locs = {'path': path, 'sigfile': sigfile, 'task': task, 'd': d} | 475 | locs = {'path': path, 'sigfile': sigfile, 'task': task, 'd': d} |
| 475 | 476 | ||
| 476 | (module, method) = self.method.rsplit('.', 1) | 477 | if "." in self.method: |
| 477 | locs['method'] = getattr(importlib.import_module(module), method) | 478 | (module, method) = self.method.rsplit('.', 1) |
| 478 | 479 | locs['method'] = getattr(importlib.import_module(module), method) | |
| 479 | outhash = bb.utils.better_eval('method(path, sigfile, task, d)', locs) | 480 | outhash = bb.utils.better_eval('method(path, sigfile, task, d)', locs) |
| 481 | else: | ||
| 482 | outhash = bb.utils.better_eval(self.method + '(path, sigfile, task, d)', locs) | ||
| 480 | 483 | ||
| 481 | try: | 484 | try: |
| 482 | url = '%s/v1/equivalent' % self.server | 485 | url = '%s/v1/equivalent' % self.server |
| @@ -527,6 +530,18 @@ class SignatureGeneratorUniHashMixIn(object): | |||
| 527 | except OSError: | 530 | except OSError: |
| 528 | pass | 531 | pass |
| 529 | 532 | ||
| 533 | |||
| 534 | # | ||
| 535 | # Dummy class used for bitbake-selftest | ||
| 536 | # | ||
| 537 | class SignatureGeneratorTestEquivHash(SignatureGeneratorUniHashMixIn, SignatureGeneratorBasicHash): | ||
| 538 | name = "TestEquivHash" | ||
| 539 | def init_rundepcheck(self, data): | ||
| 540 | super().init_rundepcheck(data) | ||
| 541 | self.server = "http://" + data.getVar('BB_HASHSERVE') | ||
| 542 | self.method = "sstate_output_hash" | ||
| 543 | |||
| 544 | |||
| 530 | def dump_this_task(outfile, d): | 545 | def dump_this_task(outfile, d): |
| 531 | import bb.parse | 546 | import bb.parse |
| 532 | fn = d.getVar("BB_FILENAME") | 547 | fn = d.getVar("BB_FILENAME") |
