summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/buildhistory.bbclass21
1 files changed, 19 insertions, 2 deletions
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index 33eb1b00f6..796f68cf8f 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -672,12 +672,29 @@ def buildhistory_get_build_id(d):
672 statusheader = d.getVar('BUILDCFG_HEADER') 672 statusheader = d.getVar('BUILDCFG_HEADER')
673 return('\n%s\n%s\n' % (statusheader, '\n'.join(statuslines))) 673 return('\n%s\n%s\n' % (statusheader, '\n'.join(statuslines)))
674 674
675def buildhistory_get_modified(path):
676 # copied from get_layer_git_status() in image-buildinfo.bbclass
677 import subprocess
678 try:
679 subprocess.check_output("""cd %s; export PSEUDO_UNLOAD=1; set -e;
680 git diff --quiet --no-ext-diff
681 git diff --quiet --no-ext-diff --cached""" % path,
682 shell=True,
683 stderr=subprocess.STDOUT)
684 return ""
685 except subprocess.CalledProcessError as ex:
686 # Silently treat errors as "modified", without checking for the
687 # (expected) return code 1 in a modified git repo. For example, we get
688 # output and a 129 return code when a layer isn't a git repo at all.
689 return " -- modified"
690
675def buildhistory_get_metadata_revs(d): 691def buildhistory_get_metadata_revs(d):
676 # We want an easily machine-readable format here, so get_layers_branch_rev isn't quite what we want 692 # We want an easily machine-readable format here, so get_layers_branch_rev isn't quite what we want
677 layers = (d.getVar("BBLAYERS") or "").split() 693 layers = (d.getVar("BBLAYERS") or "").split()
678 medadata_revs = ["%-17s = %s:%s" % (os.path.basename(i), \ 694 medadata_revs = ["%-17s = %s:%s%s" % (os.path.basename(i), \
679 base_get_metadata_git_branch(i, None).strip(), \ 695 base_get_metadata_git_branch(i, None).strip(), \
680 base_get_metadata_git_revision(i, None)) \ 696 base_get_metadata_git_revision(i, None), \
697 buildhistory_get_modified(i)) \
681 for i in layers] 698 for i in layers]
682 return '\n'.join(medadata_revs) 699 return '\n'.join(medadata_revs)
683 700