diff options
| -rw-r--r-- | meta/classes/buildhistory.bbclass | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass index 601b29f5a1..81784eef21 100644 --- a/meta/classes/buildhistory.bbclass +++ b/meta/classes/buildhistory.bbclass | |||
| @@ -301,6 +301,8 @@ python buildhistory_emit_outputsigs() { | |||
| 301 | if not "task" in (d.getVar('BUILDHISTORY_FEATURES') or "").split(): | 301 | if not "task" in (d.getVar('BUILDHISTORY_FEATURES') or "").split(): |
| 302 | return | 302 | return |
| 303 | 303 | ||
| 304 | import hashlib | ||
| 305 | |||
| 304 | taskoutdir = os.path.join(d.getVar('BUILDHISTORY_DIR'), 'task', 'output') | 306 | taskoutdir = os.path.join(d.getVar('BUILDHISTORY_DIR'), 'task', 'output') |
| 305 | bb.utils.mkdirhier(taskoutdir) | 307 | bb.utils.mkdirhier(taskoutdir) |
| 306 | currenttask = d.getVar('BB_CURRENTTASK') | 308 | currenttask = d.getVar('BB_CURRENTTASK') |
| @@ -314,7 +316,17 @@ python buildhistory_emit_outputsigs() { | |||
| 314 | if fname == 'fixmepath': | 316 | if fname == 'fixmepath': |
| 315 | continue | 317 | continue |
| 316 | fullpath = os.path.join(root, fname) | 318 | fullpath = os.path.join(root, fname) |
| 317 | filesigs[os.path.relpath(fullpath, cwd)] = bb.utils.sha256_file(fullpath) | 319 | try: |
| 320 | if os.path.islink(fullpath): | ||
| 321 | sha256 = hashlib.sha256(os.readlink(fullpath).encode('utf-8')).hexdigest() | ||
| 322 | elif os.path.isfile(fullpath): | ||
| 323 | sha256 = bb.utils.sha256_file(fullpath) | ||
| 324 | else: | ||
| 325 | continue | ||
| 326 | except OSError: | ||
| 327 | bb.warn('buildhistory: unable to read %s to get output signature' % fullpath) | ||
| 328 | continue | ||
| 329 | filesigs[os.path.relpath(fullpath, cwd)] = sha256 | ||
| 318 | with open(taskfile, 'w') as f: | 330 | with open(taskfile, 'w') as f: |
| 319 | for fpath, fsig in sorted(filesigs.items(), key=lambda item: item[0]): | 331 | for fpath, fsig in sorted(filesigs.items(), key=lambda item: item[0]): |
| 320 | f.write('%s %s\n' % (fpath, fsig)) | 332 | f.write('%s %s\n' % (fpath, fsig)) |
