diff options
-rw-r--r-- | meta/classes-global/sstate.bbclass | 5 | ||||
-rw-r--r-- | meta/classes/buildhistory.bbclass | 39 |
2 files changed, 23 insertions, 21 deletions
diff --git a/meta/classes-global/sstate.bbclass b/meta/classes-global/sstate.bbclass index fdd529ee4e..586757afbd 100644 --- a/meta/classes-global/sstate.bbclass +++ b/meta/classes-global/sstate.bbclass | |||
@@ -161,7 +161,10 @@ python () { | |||
161 | d.setVar('SSTATETASKS', " ".join(unique_tasks)) | 161 | d.setVar('SSTATETASKS', " ".join(unique_tasks)) |
162 | for task in unique_tasks: | 162 | for task in unique_tasks: |
163 | d.prependVarFlag(task, 'prefuncs', "sstate_task_prefunc ") | 163 | d.prependVarFlag(task, 'prefuncs', "sstate_task_prefunc ") |
164 | d.appendVarFlag(task, 'postfuncs', " sstate_task_postfunc") | 164 | # Generally sstate should be last, execpt for buildhistory functions |
165 | postfuncs = (d.getVarFlag(task, 'postfuncs') or "").split() | ||
166 | newpostfuncs = [p for p in postfuncs if "buildhistory" not in p] + ["sstate_task_postfunc"] + [p for p in postfuncs if "buildhistory" in p] | ||
167 | d.setVarFlag(task, 'postfuncs', " ".join(newpostfuncs)) | ||
165 | d.setVarFlag(task, 'network', '1') | 168 | d.setVarFlag(task, 'network', '1') |
166 | d.setVarFlag(task + "_setscene", 'network', '1') | 169 | d.setVarFlag(task + "_setscene", 'network', '1') |
167 | } | 170 | } |
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass index bac2abdab0..ce3abaa69d 100644 --- a/meta/classes/buildhistory.bbclass +++ b/meta/classes/buildhistory.bbclass | |||
@@ -47,11 +47,18 @@ BUILDHISTORY_PUSH_REPO ?= "" | |||
47 | BUILDHISTORY_TAG ?= "build" | 47 | BUILDHISTORY_TAG ?= "build" |
48 | BUILDHISTORY_PATH_PREFIX_STRIP ?= "" | 48 | BUILDHISTORY_PATH_PREFIX_STRIP ?= "" |
49 | 49 | ||
50 | SSTATEPOSTINSTFUNCS:append = " buildhistory_emit_pkghistory" | 50 | # We want to avoid influencing the signatures of the task so use vardepsexclude |
51 | # We want to avoid influencing the signatures of sstate tasks - first the function itself: | 51 | do_populate_sysroot[postfuncs] += "buildhistory_emit_sysroot" |
52 | sstate_install[vardepsexclude] += "buildhistory_emit_pkghistory" | 52 | do_populate_sysroot_setscene[postfuncs] += "buildhistory_emit_sysroot" |
53 | # then the value added to SSTATEPOSTINSTFUNCS: | 53 | do_populate_sysroot[vardepsexclude] += "buildhistory_emit_sysroot" |
54 | SSTATEPOSTINSTFUNCS[vardepvalueexclude] .= "| buildhistory_emit_pkghistory" | 54 | |
55 | do_package[postfuncs] += "buildhistory_list_pkg_files" | ||
56 | do_package_setscene[postfuncs] += "buildhistory_list_pkg_files" | ||
57 | do_package[vardepsexclude] += "buildhistory_list_pkg_files" | ||
58 | |||
59 | do_packagedata[postfuncs] += "buildhistory_emit_pkghistory" | ||
60 | do_packagedata_setscene[postfuncs] += "buildhistory_emit_pkghistory" | ||
61 | do_packagedata[vardepsexclude] += "buildhistory_emit_pkghistory" | ||
55 | 62 | ||
56 | # Similarly for our function that gets the output signatures | 63 | # Similarly for our function that gets the output signatures |
57 | SSTATEPOSTUNPACKFUNCS:append = " buildhistory_emit_outputsigs" | 64 | SSTATEPOSTUNPACKFUNCS:append = " buildhistory_emit_outputsigs" |
@@ -91,27 +98,15 @@ buildhistory_emit_sysroot() { | |||
91 | # Write out metadata about this package for comparison when writing future packages | 98 | # Write out metadata about this package for comparison when writing future packages |
92 | # | 99 | # |
93 | python buildhistory_emit_pkghistory() { | 100 | python buildhistory_emit_pkghistory() { |
94 | if d.getVar('BB_CURRENTTASK') in ['populate_sysroot', 'populate_sysroot_setscene']: | ||
95 | bb.build.exec_func("buildhistory_emit_sysroot", d) | ||
96 | return 0 | ||
97 | |||
98 | if not "package" in (d.getVar('BUILDHISTORY_FEATURES') or "").split(): | ||
99 | return 0 | ||
100 | |||
101 | if d.getVar('BB_CURRENTTASK') in ['package', 'package_setscene']: | ||
102 | # Create files-in-<package-name>.txt files containing a list of files of each recipe's package | ||
103 | bb.build.exec_func("buildhistory_list_pkg_files", d) | ||
104 | return 0 | ||
105 | |||
106 | if not d.getVar('BB_CURRENTTASK') in ['packagedata', 'packagedata_setscene']: | ||
107 | return 0 | ||
108 | |||
109 | import re | 101 | import re |
110 | import json | 102 | import json |
111 | import shlex | 103 | import shlex |
112 | import errno | 104 | import errno |
113 | import shutil | 105 | import shutil |
114 | 106 | ||
107 | if not "package" in (d.getVar('BUILDHISTORY_FEATURES') or "").split(): | ||
108 | return 0 | ||
109 | |||
115 | pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE') | 110 | pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE') |
116 | oldpkghistdir = d.getVar('BUILDHISTORY_OLD_DIR_PACKAGE') | 111 | oldpkghistdir = d.getVar('BUILDHISTORY_OLD_DIR_PACKAGE') |
117 | 112 | ||
@@ -621,6 +616,10 @@ buildhistory_list_files_no_owners() { | |||
621 | } | 616 | } |
622 | 617 | ||
623 | buildhistory_list_pkg_files() { | 618 | buildhistory_list_pkg_files() { |
619 | if [ "${@bb.utils.contains('BUILDHISTORY_FEATURES', 'package', '1', '0', d)}" = "0" ] ; then | ||
620 | return | ||
621 | fi | ||
622 | |||
624 | # Create individual files-in-package for each recipe's package | 623 | # Create individual files-in-package for each recipe's package |
625 | pkgdirlist=$(find ${PKGDEST}/* -maxdepth 0 -type d) | 624 | pkgdirlist=$(find ${PKGDEST}/* -maxdepth 0 -type d) |
626 | for pkgdir in $pkgdirlist; do | 625 | for pkgdir in $pkgdirlist; do |