diff options
Diffstat (limited to 'meta/classes/buildhistory.bbclass')
-rw-r--r-- | meta/classes/buildhistory.bbclass | 158 |
1 files changed, 77 insertions, 81 deletions
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass index 117a44eaf3..fd53e92402 100644 --- a/meta/classes/buildhistory.bbclass +++ b/meta/classes/buildhistory.bbclass | |||
@@ -6,8 +6,10 @@ | |||
6 | # Copyright (C) 2011-2016 Intel Corporation | 6 | # Copyright (C) 2011-2016 Intel Corporation |
7 | # Copyright (C) 2007-2011 Koen Kooi <koen@openembedded.org> | 7 | # Copyright (C) 2007-2011 Koen Kooi <koen@openembedded.org> |
8 | # | 8 | # |
9 | # SPDX-License-Identifier: MIT | ||
10 | # | ||
9 | 11 | ||
10 | inherit image-artifact-names | 12 | IMAGE_CLASSES += "image-artifact-names" |
11 | 13 | ||
12 | BUILDHISTORY_FEATURES ?= "image package sdk" | 14 | BUILDHISTORY_FEATURES ?= "image package sdk" |
13 | BUILDHISTORY_DIR ?= "${TOPDIR}/buildhistory" | 15 | BUILDHISTORY_DIR ?= "${TOPDIR}/buildhistory" |
@@ -31,7 +33,7 @@ BUILDHISTORY_DIR_PACKAGE = "${BUILDHISTORY_DIR}/packages/${MULTIMACH_TARGET_SYS} | |||
31 | # of failed builds. | 33 | # of failed builds. |
32 | # | 34 | # |
33 | # The expected usage is via auto.conf, but passing via the command line also works | 35 | # The expected usage is via auto.conf, but passing via the command line also works |
34 | # with: BB_ENV_EXTRAWHITE=BUILDHISTORY_RESET BUILDHISTORY_RESET=1 | 36 | # with: BB_ENV_PASSTHROUGH_ADDITIONS=BUILDHISTORY_RESET BUILDHISTORY_RESET=1 |
35 | BUILDHISTORY_RESET ?= "" | 37 | BUILDHISTORY_RESET ?= "" |
36 | 38 | ||
37 | BUILDHISTORY_OLD_DIR = "${BUILDHISTORY_DIR}/${@ "old" if "${BUILDHISTORY_RESET}" else ""}" | 39 | BUILDHISTORY_OLD_DIR = "${BUILDHISTORY_DIR}/${@ "old" if "${BUILDHISTORY_RESET}" else ""}" |
@@ -43,15 +45,16 @@ BUILDHISTORY_COMMIT ?= "1" | |||
43 | BUILDHISTORY_COMMIT_AUTHOR ?= "buildhistory <buildhistory@${DISTRO}>" | 45 | BUILDHISTORY_COMMIT_AUTHOR ?= "buildhistory <buildhistory@${DISTRO}>" |
44 | BUILDHISTORY_PUSH_REPO ?= "" | 46 | BUILDHISTORY_PUSH_REPO ?= "" |
45 | BUILDHISTORY_TAG ?= "build" | 47 | BUILDHISTORY_TAG ?= "build" |
48 | BUILDHISTORY_PATH_PREFIX_STRIP ?= "" | ||
46 | 49 | ||
47 | SSTATEPOSTINSTFUNCS_append = " buildhistory_emit_pkghistory" | 50 | SSTATEPOSTINSTFUNCS:append = " buildhistory_emit_pkghistory" |
48 | # We want to avoid influencing the signatures of sstate tasks - first the function itself: | 51 | # We want to avoid influencing the signatures of sstate tasks - first the function itself: |
49 | sstate_install[vardepsexclude] += "buildhistory_emit_pkghistory" | 52 | sstate_install[vardepsexclude] += "buildhistory_emit_pkghistory" |
50 | # then the value added to SSTATEPOSTINSTFUNCS: | 53 | # then the value added to SSTATEPOSTINSTFUNCS: |
51 | SSTATEPOSTINSTFUNCS[vardepvalueexclude] .= "| buildhistory_emit_pkghistory" | 54 | SSTATEPOSTINSTFUNCS[vardepvalueexclude] .= "| buildhistory_emit_pkghistory" |
52 | 55 | ||
53 | # Similarly for our function that gets the output signatures | 56 | # Similarly for our function that gets the output signatures |
54 | SSTATEPOSTUNPACKFUNCS_append = " buildhistory_emit_outputsigs" | 57 | SSTATEPOSTUNPACKFUNCS:append = " buildhistory_emit_outputsigs" |
55 | sstate_installpkgdir[vardepsexclude] += "buildhistory_emit_outputsigs" | 58 | sstate_installpkgdir[vardepsexclude] += "buildhistory_emit_outputsigs" |
56 | SSTATEPOSTUNPACKFUNCS[vardepvalueexclude] .= "| buildhistory_emit_outputsigs" | 59 | SSTATEPOSTUNPACKFUNCS[vardepvalueexclude] .= "| buildhistory_emit_outputsigs" |
57 | 60 | ||
@@ -90,13 +93,19 @@ buildhistory_emit_sysroot() { | |||
90 | python buildhistory_emit_pkghistory() { | 93 | python buildhistory_emit_pkghistory() { |
91 | if d.getVar('BB_CURRENTTASK') in ['populate_sysroot', 'populate_sysroot_setscene']: | 94 | if d.getVar('BB_CURRENTTASK') in ['populate_sysroot', 'populate_sysroot_setscene']: |
92 | bb.build.exec_func("buildhistory_emit_sysroot", d) | 95 | bb.build.exec_func("buildhistory_emit_sysroot", d) |
93 | |||
94 | if not d.getVar('BB_CURRENTTASK') in ['packagedata', 'packagedata_setscene']: | ||
95 | return 0 | 96 | return 0 |
96 | 97 | ||
97 | if not "package" in (d.getVar('BUILDHISTORY_FEATURES') or "").split(): | 98 | if not "package" in (d.getVar('BUILDHISTORY_FEATURES') or "").split(): |
98 | return 0 | 99 | return 0 |
99 | 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 | |||
100 | import re | 109 | import re |
101 | import json | 110 | import json |
102 | import shlex | 111 | import shlex |
@@ -286,7 +295,7 @@ python buildhistory_emit_pkghistory() { | |||
286 | r = bb.utils.vercmp((pkge, pkgv, pkgr), (last_pkge, last_pkgv, last_pkgr)) | 295 | r = bb.utils.vercmp((pkge, pkgv, pkgr), (last_pkge, last_pkgv, last_pkgr)) |
287 | if r < 0: | 296 | if r < 0: |
288 | msg = "Package version for package %s went backwards which would break package feeds (from %s:%s-%s to %s:%s-%s)" % (pkg, last_pkge, last_pkgv, last_pkgr, pkge, pkgv, pkgr) | 297 | msg = "Package version for package %s went backwards which would break package feeds (from %s:%s-%s to %s:%s-%s)" % (pkg, last_pkge, last_pkgv, last_pkgr, pkge, pkgv, pkgr) |
289 | package_qa_handle_error("version-going-backwards", msg, d) | 298 | oe.qa.handle_error("version-going-backwards", msg, d) |
290 | 299 | ||
291 | pkginfo = PackageInfo(pkg) | 300 | pkginfo = PackageInfo(pkg) |
292 | # Apparently the version can be different on a per-package basis (see Python) | 301 | # Apparently the version can be different on a per-package basis (see Python) |
@@ -318,8 +327,7 @@ python buildhistory_emit_pkghistory() { | |||
318 | 327 | ||
319 | write_pkghistory(pkginfo, d) | 328 | write_pkghistory(pkginfo, d) |
320 | 329 | ||
321 | # Create files-in-<package-name>.txt files containing a list of files of each recipe's package | 330 | oe.qa.exit_if_errors(d) |
322 | bb.build.exec_func("buildhistory_list_pkg_files", d) | ||
323 | } | 331 | } |
324 | 332 | ||
325 | python buildhistory_emit_outputsigs() { | 333 | python buildhistory_emit_outputsigs() { |
@@ -441,11 +449,16 @@ def buildhistory_list_installed(d, rootfs_type="image"): | |||
441 | else: | 449 | else: |
442 | pkgs = sdk_list_installed_packages(d, rootfs_type == "sdk_target") | 450 | pkgs = sdk_list_installed_packages(d, rootfs_type == "sdk_target") |
443 | 451 | ||
452 | if rootfs_type == "sdk_host": | ||
453 | pkgdata_dir = d.getVar('PKGDATA_DIR_SDK') | ||
454 | else: | ||
455 | pkgdata_dir = d.getVar('PKGDATA_DIR') | ||
456 | |||
444 | for output_type, output_file in process_list: | 457 | for output_type, output_file in process_list: |
445 | output_file_full = os.path.join(d.getVar('WORKDIR'), output_file) | 458 | output_file_full = os.path.join(d.getVar('WORKDIR'), output_file) |
446 | 459 | ||
447 | with open(output_file_full, 'w') as output: | 460 | with open(output_file_full, 'w') as output: |
448 | output.write(format_pkg_list(pkgs, output_type)) | 461 | output.write(format_pkg_list(pkgs, output_type, pkgdata_dir)) |
449 | 462 | ||
450 | python buildhistory_list_installed_image() { | 463 | python buildhistory_list_installed_image() { |
451 | buildhistory_list_installed(d) | 464 | buildhistory_list_installed(d) |
@@ -486,6 +499,8 @@ buildhistory_get_installed() { | |||
486 | -e 's:|: -> :' \ | 499 | -e 's:|: -> :' \ |
487 | -e 's:"\[REC\]":[style=dotted]:' \ | 500 | -e 's:"\[REC\]":[style=dotted]:' \ |
488 | -e 's:"\([<>=]\+\)" "\([^"]*\)":[label="\1 \2"]:' \ | 501 | -e 's:"\([<>=]\+\)" "\([^"]*\)":[label="\1 \2"]:' \ |
502 | -e 's:"\([*]\+\)" "\([^"]*\)":[label="\2"]:' \ | ||
503 | -e 's:"\[RPROVIDES\]":[style=dashed]:' \ | ||
489 | $1/depends.tmp | 504 | $1/depends.tmp |
490 | # Add header, sorted and de-duped contents and footer and then delete the temp file | 505 | # Add header, sorted and de-duped contents and footer and then delete the temp file |
491 | printf "digraph depends {\n node [shape=plaintext]\n" > $1/depends.dot | 506 | printf "digraph depends {\n node [shape=plaintext]\n" > $1/depends.dot |
@@ -493,11 +508,22 @@ buildhistory_get_installed() { | |||
493 | echo "}" >> $1/depends.dot | 508 | echo "}" >> $1/depends.dot |
494 | rm $1/depends.tmp | 509 | rm $1/depends.tmp |
495 | 510 | ||
511 | # Set correct pkgdatadir | ||
512 | pkgdatadir=${PKGDATA_DIR} | ||
513 | if [ "$2" = "sdk" ] && [ "$3" = "host" ] ; then | ||
514 | pkgdatadir="${PKGDATA_DIR_SDK}" | ||
515 | fi | ||
516 | |||
496 | # Produce installed package sizes list | 517 | # Produce installed package sizes list |
497 | oe-pkgdata-util -p ${PKGDATA_DIR} read-value "PKGSIZE" -n -f $pkgcache > $1/installed-package-sizes.tmp | 518 | oe-pkgdata-util -p $pkgdatadir read-value "PKGSIZE" -n -f $pkgcache > $1/installed-package-sizes.tmp |
498 | cat $1/installed-package-sizes.tmp | awk '{print $2 "\tKiB\t" $1}' | sort -n -r > $1/installed-package-sizes.txt | 519 | cat $1/installed-package-sizes.tmp | awk '{print $2 "\tKiB\t" $1}' | sort -n -r > $1/installed-package-sizes.txt |
499 | rm $1/installed-package-sizes.tmp | 520 | rm $1/installed-package-sizes.tmp |
500 | 521 | ||
522 | # Produce package info: runtime_name, buildtime_name, recipe, version, size | ||
523 | oe-pkgdata-util -p $pkgdatadir read-value "PACKAGE,PN,PV,PKGSIZE" -n -f $pkgcache > $1/installed-package-info.tmp | ||
524 | cat $1/installed-package-info.tmp | sort -n -r -k 5 > $1/installed-package-info.txt | ||
525 | rm $1/installed-package-info.tmp | ||
526 | |||
501 | # We're now done with the cache, delete it | 527 | # We're now done with the cache, delete it |
502 | rm $pkgcache | 528 | rm $pkgcache |
503 | 529 | ||
@@ -534,7 +560,7 @@ buildhistory_get_sdk_installed() { | |||
534 | return | 560 | return |
535 | fi | 561 | fi |
536 | 562 | ||
537 | buildhistory_get_installed ${BUILDHISTORY_DIR_SDK}/$1 sdk | 563 | buildhistory_get_installed ${BUILDHISTORY_DIR_SDK}/$1 sdk $1 |
538 | } | 564 | } |
539 | 565 | ||
540 | buildhistory_get_sdk_installed_host() { | 566 | buildhistory_get_sdk_installed_host() { |
@@ -665,26 +691,29 @@ python buildhistory_get_extra_sdkinfo() { | |||
665 | 691 | ||
666 | # By using ROOTFS_POSTUNINSTALL_COMMAND we get in after uninstallation of | 692 | # By using ROOTFS_POSTUNINSTALL_COMMAND we get in after uninstallation of |
667 | # unneeded packages but before the removal of packaging files | 693 | # unneeded packages but before the removal of packaging files |
668 | ROOTFS_POSTUNINSTALL_COMMAND += "buildhistory_list_installed_image ;" | 694 | ROOTFS_POSTUNINSTALL_COMMAND += "buildhistory_list_installed_image" |
669 | ROOTFS_POSTUNINSTALL_COMMAND += "buildhistory_get_image_installed ;" | 695 | ROOTFS_POSTUNINSTALL_COMMAND += "buildhistory_get_image_installed" |
670 | ROOTFS_POSTUNINSTALL_COMMAND[vardepvalueexclude] .= "| buildhistory_list_installed_image ;| buildhistory_get_image_installed ;" | 696 | ROOTFS_POSTUNINSTALL_COMMAND[vardepvalueexclude] .= "| buildhistory_list_installed_image| buildhistory_get_image_installed" |
671 | ROOTFS_POSTUNINSTALL_COMMAND[vardepsexclude] += "buildhistory_list_installed_image buildhistory_get_image_installed" | 697 | ROOTFS_POSTUNINSTALL_COMMAND[vardepsexclude] += "buildhistory_list_installed_image buildhistory_get_image_installed" |
672 | 698 | ||
673 | IMAGE_POSTPROCESS_COMMAND += "buildhistory_get_imageinfo ;" | 699 | IMAGE_POSTPROCESS_COMMAND += "buildhistory_get_imageinfo" |
674 | IMAGE_POSTPROCESS_COMMAND[vardepvalueexclude] .= "| buildhistory_get_imageinfo ;" | 700 | IMAGE_POSTPROCESS_COMMAND[vardepvalueexclude] .= "| buildhistory_get_imageinfo" |
675 | IMAGE_POSTPROCESS_COMMAND[vardepsexclude] += "buildhistory_get_imageinfo" | 701 | IMAGE_POSTPROCESS_COMMAND[vardepsexclude] += "buildhistory_get_imageinfo" |
676 | 702 | ||
677 | # We want these to be the last run so that we get called after complementary package installation | 703 | # We want these to be the last run so that we get called after complementary package installation |
678 | POPULATE_SDK_POST_TARGET_COMMAND_append = " buildhistory_list_installed_sdk_target;" | 704 | POPULATE_SDK_POST_TARGET_COMMAND:append = " buildhistory_list_installed_sdk_target" |
679 | POPULATE_SDK_POST_TARGET_COMMAND_append = " buildhistory_get_sdk_installed_target;" | 705 | POPULATE_SDK_POST_TARGET_COMMAND:append = " buildhistory_get_sdk_installed_target" |
680 | POPULATE_SDK_POST_TARGET_COMMAND[vardepvalueexclude] .= "| buildhistory_list_installed_sdk_target;| buildhistory_get_sdk_installed_target;" | 706 | POPULATE_SDK_POST_TARGET_COMMAND[vardepvalueexclude] .= "| buildhistory_list_installed_sdk_target| buildhistory_get_sdk_installed_target" |
707 | POPULATE_SDK_POST_TARGET_COMMAND[vardepsexclude] += "buildhistory_list_installed_sdk_target buildhistory_get_sdk_installed_target" | ||
681 | 708 | ||
682 | POPULATE_SDK_POST_HOST_COMMAND_append = " buildhistory_list_installed_sdk_host;" | 709 | POPULATE_SDK_POST_HOST_COMMAND:append = " buildhistory_list_installed_sdk_host" |
683 | POPULATE_SDK_POST_HOST_COMMAND_append = " buildhistory_get_sdk_installed_host;" | 710 | POPULATE_SDK_POST_HOST_COMMAND:append = " buildhistory_get_sdk_installed_host" |
684 | POPULATE_SDK_POST_HOST_COMMAND[vardepvalueexclude] .= "| buildhistory_list_installed_sdk_host;| buildhistory_get_sdk_installed_host;" | 711 | POPULATE_SDK_POST_HOST_COMMAND[vardepvalueexclude] .= "| buildhistory_list_installed_sdk_host| buildhistory_get_sdk_installed_host" |
712 | POPULATE_SDK_POST_HOST_COMMAND[vardepsexclude] += "buildhistory_list_installed_sdk_host buildhistory_get_sdk_installed_host" | ||
685 | 713 | ||
686 | SDK_POSTPROCESS_COMMAND_append = " buildhistory_get_sdkinfo ; buildhistory_get_extra_sdkinfo; " | 714 | SDK_POSTPROCESS_COMMAND:append = " buildhistory_get_sdkinfo buildhistory_get_extra_sdkinfo" |
687 | SDK_POSTPROCESS_COMMAND[vardepvalueexclude] .= "| buildhistory_get_sdkinfo ; buildhistory_get_extra_sdkinfo; " | 715 | SDK_POSTPROCESS_COMMAND[vardepvalueexclude] .= "| buildhistory_get_sdkinfo buildhistory_get_extra_sdkinfo" |
716 | SDK_POSTPROCESS_COMMAND[vardepsexclude] += "buildhistory_get_sdkinfo buildhistory_get_extra_sdkinfo" | ||
688 | 717 | ||
689 | python buildhistory_write_sigs() { | 718 | python buildhistory_write_sigs() { |
690 | if not "task" in (d.getVar('BUILDHISTORY_FEATURES') or "").split(): | 719 | if not "task" in (d.getVar('BUILDHISTORY_FEATURES') or "").split(): |
@@ -694,7 +723,7 @@ python buildhistory_write_sigs() { | |||
694 | if hasattr(bb.parse.siggen, 'dump_siglist'): | 723 | if hasattr(bb.parse.siggen, 'dump_siglist'): |
695 | taskoutdir = os.path.join(d.getVar('BUILDHISTORY_DIR'), 'task') | 724 | taskoutdir = os.path.join(d.getVar('BUILDHISTORY_DIR'), 'task') |
696 | bb.utils.mkdirhier(taskoutdir) | 725 | bb.utils.mkdirhier(taskoutdir) |
697 | bb.parse.siggen.dump_siglist(os.path.join(taskoutdir, 'tasksigs.txt')) | 726 | bb.parse.siggen.dump_siglist(os.path.join(taskoutdir, 'tasksigs.txt'), d.getVar("BUILDHISTORY_PATH_PREFIX_STRIP")) |
698 | } | 727 | } |
699 | 728 | ||
700 | def buildhistory_get_build_id(d): | 729 | def buildhistory_get_build_id(d): |
@@ -714,30 +743,10 @@ def buildhistory_get_build_id(d): | |||
714 | statusheader = d.getVar('BUILDCFG_HEADER') | 743 | statusheader = d.getVar('BUILDCFG_HEADER') |
715 | return('\n%s\n%s\n' % (statusheader, '\n'.join(statuslines))) | 744 | return('\n%s\n%s\n' % (statusheader, '\n'.join(statuslines))) |
716 | 745 | ||
717 | def buildhistory_get_modified(path): | ||
718 | # copied from get_layer_git_status() in image-buildinfo.bbclass | ||
719 | import subprocess | ||
720 | try: | ||
721 | subprocess.check_output("""cd %s; export PSEUDO_UNLOAD=1; set -e; | ||
722 | git diff --quiet --no-ext-diff | ||
723 | git diff --quiet --no-ext-diff --cached""" % path, | ||
724 | shell=True, | ||
725 | stderr=subprocess.STDOUT) | ||
726 | return "" | ||
727 | except subprocess.CalledProcessError as ex: | ||
728 | # Silently treat errors as "modified", without checking for the | ||
729 | # (expected) return code 1 in a modified git repo. For example, we get | ||
730 | # output and a 129 return code when a layer isn't a git repo at all. | ||
731 | return " -- modified" | ||
732 | |||
733 | def buildhistory_get_metadata_revs(d): | 746 | def buildhistory_get_metadata_revs(d): |
734 | # We want an easily machine-readable format here, so get_layers_branch_rev isn't quite what we want | 747 | # We want an easily machine-readable format here |
735 | layers = (d.getVar("BBLAYERS") or "").split() | 748 | revisions = oe.buildcfg.get_layer_revisions(d) |
736 | medadata_revs = ["%-17s = %s:%s%s" % (os.path.basename(i), \ | 749 | medadata_revs = ["%-17s = %s:%s%s" % (r[1], r[2], r[3], r[4]) for r in revisions] |
737 | base_get_metadata_git_branch(i, None).strip(), \ | ||
738 | base_get_metadata_git_revision(i, None), \ | ||
739 | buildhistory_get_modified(i)) \ | ||
740 | for i in layers] | ||
741 | return '\n'.join(medadata_revs) | 750 | return '\n'.join(medadata_revs) |
742 | 751 | ||
743 | def outputvars(vars, listvars, d): | 752 | def outputvars(vars, listvars, d): |
@@ -762,11 +771,11 @@ def buildhistory_get_imagevars(d): | |||
762 | def buildhistory_get_sdkvars(d): | 771 | def buildhistory_get_sdkvars(d): |
763 | if d.getVar('BB_WORKERCONTEXT') != '1': | 772 | if d.getVar('BB_WORKERCONTEXT') != '1': |
764 | return "" | 773 | return "" |
765 | sdkvars = "DISTRO DISTRO_VERSION SDK_NAME SDK_VERSION SDKMACHINE SDKIMAGE_FEATURES BAD_RECOMMENDATIONS NO_RECOMMENDATIONS PACKAGE_EXCLUDE" | 774 | sdkvars = "DISTRO DISTRO_VERSION SDK_NAME SDK_VERSION SDKMACHINE SDKIMAGE_FEATURES TOOLCHAIN_HOST_TASK TOOLCHAIN_TARGET_TASK BAD_RECOMMENDATIONS NO_RECOMMENDATIONS PACKAGE_EXCLUDE" |
766 | if d.getVar('BB_CURRENTTASK') == 'populate_sdk_ext': | 775 | if d.getVar('BB_CURRENTTASK') == 'populate_sdk_ext': |
767 | # Extensible SDK uses some additional variables | 776 | # Extensible SDK uses some additional variables |
768 | sdkvars += " SDK_LOCAL_CONF_WHITELIST SDK_LOCAL_CONF_BLACKLIST SDK_INHERIT_BLACKLIST SDK_UPDATE_URL SDK_EXT_TYPE SDK_RECRDEP_TASKS SDK_INCLUDE_PKGDATA SDK_INCLUDE_TOOLCHAIN" | 777 | sdkvars += " ESDK_LOCALCONF_ALLOW ESDK_LOCALCONF_REMOVE ESDK_CLASS_INHERIT_DISABLE SDK_UPDATE_URL SDK_EXT_TYPE SDK_RECRDEP_TASKS SDK_INCLUDE_PKGDATA SDK_INCLUDE_TOOLCHAIN" |
769 | listvars = "SDKIMAGE_FEATURES BAD_RECOMMENDATIONS PACKAGE_EXCLUDE SDK_LOCAL_CONF_WHITELIST SDK_LOCAL_CONF_BLACKLIST SDK_INHERIT_BLACKLIST" | 778 | listvars = "SDKIMAGE_FEATURES BAD_RECOMMENDATIONS PACKAGE_EXCLUDE ESDK_LOCALCONF_ALLOW ESDK_LOCALCONF_REMOVE ESDK_CLASS_INHERIT_DISABLE" |
770 | return outputvars(sdkvars, listvars, d) | 779 | return outputvars(sdkvars, listvars, d) |
771 | 780 | ||
772 | 781 | ||
@@ -869,10 +878,11 @@ python buildhistory_eventhandler() { | |||
869 | if os.path.isdir(olddir): | 878 | if os.path.isdir(olddir): |
870 | shutil.rmtree(olddir) | 879 | shutil.rmtree(olddir) |
871 | rootdir = e.data.getVar("BUILDHISTORY_DIR") | 880 | rootdir = e.data.getVar("BUILDHISTORY_DIR") |
881 | bb.utils.mkdirhier(rootdir) | ||
872 | entries = [ x for x in os.listdir(rootdir) if not x.startswith('.') ] | 882 | entries = [ x for x in os.listdir(rootdir) if not x.startswith('.') ] |
873 | bb.utils.mkdirhier(olddir) | 883 | bb.utils.mkdirhier(olddir) |
874 | for entry in entries: | 884 | for entry in entries: |
875 | os.rename(os.path.join(rootdir, entry), | 885 | bb.utils.rename(os.path.join(rootdir, entry), |
876 | os.path.join(olddir, entry)) | 886 | os.path.join(olddir, entry)) |
877 | elif isinstance(e, bb.event.BuildCompleted): | 887 | elif isinstance(e, bb.event.BuildCompleted): |
878 | if reset: | 888 | if reset: |
@@ -911,22 +921,12 @@ def _get_srcrev_values(d): | |||
911 | if urldata[u].method.supports_srcrev(): | 921 | if urldata[u].method.supports_srcrev(): |
912 | scms.append(u) | 922 | scms.append(u) |
913 | 923 | ||
914 | autoinc_templ = 'AUTOINC+' | ||
915 | dict_srcrevs = {} | 924 | dict_srcrevs = {} |
916 | dict_tag_srcrevs = {} | 925 | dict_tag_srcrevs = {} |
917 | for scm in scms: | 926 | for scm in scms: |
918 | ud = urldata[scm] | 927 | ud = urldata[scm] |
919 | for name in ud.names: | 928 | for name in ud.names: |
920 | try: | 929 | autoinc, rev = ud.method.sortable_revision(ud, d, name) |
921 | rev = ud.method.sortable_revision(ud, d, name) | ||
922 | except TypeError: | ||
923 | # support old bitbake versions | ||
924 | rev = ud.method.sortable_revision(scm, ud, d, name) | ||
925 | # Clean this up when we next bump bitbake version | ||
926 | if type(rev) != str: | ||
927 | autoinc, rev = rev | ||
928 | elif rev.startswith(autoinc_templ): | ||
929 | rev = rev[len(autoinc_templ):] | ||
930 | dict_srcrevs[name] = rev | 930 | dict_srcrevs[name] = rev |
931 | if 'tag' in ud.parm: | 931 | if 'tag' in ud.parm: |
932 | tag = ud.parm['tag']; | 932 | tag = ud.parm['tag']; |
@@ -957,23 +957,19 @@ def write_latest_srcrev(d, pkghistdir): | |||
957 | value = value.replace('"', '').strip() | 957 | value = value.replace('"', '').strip() |
958 | old_tag_srcrevs[key] = value | 958 | old_tag_srcrevs[key] = value |
959 | with open(srcrevfile, 'w') as f: | 959 | with open(srcrevfile, 'w') as f: |
960 | orig_srcrev = d.getVar('SRCREV', False) or 'INVALID' | 960 | for name, srcrev in sorted(srcrevs.items()): |
961 | if orig_srcrev != 'INVALID': | 961 | suffix = "_" + name |
962 | f.write('# SRCREV = "%s"\n' % orig_srcrev) | 962 | if name == "default": |
963 | if len(srcrevs) > 1: | 963 | suffix = "" |
964 | for name, srcrev in sorted(srcrevs.items()): | 964 | orig_srcrev = d.getVar('SRCREV%s' % suffix, False) |
965 | orig_srcrev = d.getVar('SRCREV_%s' % name, False) | 965 | if orig_srcrev: |
966 | if orig_srcrev: | 966 | f.write('# SRCREV%s = "%s"\n' % (suffix, orig_srcrev)) |
967 | f.write('# SRCREV_%s = "%s"\n' % (name, orig_srcrev)) | 967 | f.write('SRCREV%s = "%s"\n' % (suffix, srcrev)) |
968 | f.write('SRCREV_%s = "%s"\n' % (name, srcrev)) | 968 | for name, srcrev in sorted(tag_srcrevs.items()): |
969 | else: | 969 | f.write('# tag_%s = "%s"\n' % (name, srcrev)) |
970 | f.write('SRCREV = "%s"\n' % next(iter(srcrevs.values()))) | 970 | if name in old_tag_srcrevs and old_tag_srcrevs[name] != srcrev: |
971 | if len(tag_srcrevs) > 0: | 971 | pkg = d.getVar('PN') |
972 | for name, srcrev in sorted(tag_srcrevs.items()): | 972 | bb.warn("Revision for tag %s in package %s was changed since last build (from %s to %s)" % (name, pkg, old_tag_srcrevs[name], srcrev)) |
973 | f.write('# tag_%s = "%s"\n' % (name, srcrev)) | ||
974 | if name in old_tag_srcrevs and old_tag_srcrevs[name] != srcrev: | ||
975 | pkg = d.getVar('PN') | ||
976 | bb.warn("Revision for tag %s in package %s was changed since last build (from %s to %s)" % (name, pkg, old_tag_srcrevs[name], srcrev)) | ||
977 | 973 | ||
978 | else: | 974 | else: |
979 | if os.path.exists(srcrevfile): | 975 | if os.path.exists(srcrevfile): |