From patchwork Thu Sep 19 10:10:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Ferreira X-Patchwork-Id: 49294 X-Patchwork-Delegate: steve@sakoman.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 360A3CE8D74 for ; Thu, 19 Sep 2024 10:10:32 +0000 (UTC) Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) by mx.groups.io with SMTP id smtpd.web11.16170.1726740627927856957 for ; Thu, 19 Sep 2024 03:10:28 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Sv/y9RSe; spf=pass (domain: gmail.com, ip: 209.85.221.51, mailfrom: pmi183@gmail.com) Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-374cacf18b1so393502f8f.2 for ; Thu, 19 Sep 2024 03:10:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726740626; x=1727345426; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=7QiWhXCosKJS1HW38IOZLhg86LZ1TgmFqLRpecCBnw8=; b=Sv/y9RSe8y462A4Q5E7esjsSZClO3dM6QeexnwwifDyKE4qDDdsJSMbLPDN+dNZKD3 REuFpdM8ynYxGBcPwh1hMbk2YmypAVdn9NZ3m2lNVMel3zfYUGmcFMHZRs50P+fH17ea Z5tjaslj4Lk5U2nOYT000JgpNQv/AIyS8dz+5r4wuoNEa62wBz3I8+YKezBwqzGDbrM1 VdAaYhily3n2LXh8LBZhAQaJujKE6yeBm6cCZBbVP2PLxFaijynbPD3PEfnBRzkJ0JgW cpCcnx7ftpdCytqdwGni40LmXWu50CSaX9t0nXQStyWpCtXfG4W5WXRQv7hBGYIS/E3y E/Zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726740626; x=1727345426; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7QiWhXCosKJS1HW38IOZLhg86LZ1TgmFqLRpecCBnw8=; b=YPeab4dT6n28aeFuO1DG+3krRZqfMh82aespUiMH9iuvXQQj4Gi0K1q3EIFy7tziU7 zZYpzm1vn9JM7Qm/rFHy9jtYYAeMqmpH1GWiEzsYTG5taxzUYknRdpI3/PNlJTtwQAU3 nwaWXvwXKxVLcF8HavOvGFo19p0BIckWEN0EYRivv3RfXgTibtMH/gjfEayEv53Ly0HY MZdGJrDe2Nk68T6IJ3HNzzyafN7CNhqF7ch5+IF/GfqDdH8o2AAKfHIUxT2H/CU9diP7 g6Y6evv05KG32HnwUnmwJb5MOFYhQ06VFfGZjEwL9zf/GYeAnBPsXPS0fzQ0QLGbq0iY kIhQ== X-Gm-Message-State: AOJu0Ywuw1NK1k+1h67zjrIC1rRiNTyv1EnbVqwp9XgALA0mFJsV/Hue 2/1nNva1SRv/birPOFrTAeoAN48NhBjgHz53CwcDtTucjIminEMsx+vXjNBX X-Google-Smtp-Source: AGHT+IEhcjVTYoMmTSjyScXkdXBSVEevH23assu0quyzRzGXzE+Y6hgxjvxRw2zGyHXpiXSA2h3vew== X-Received: by 2002:a5d:554d:0:b0:374:c847:85e with SMTP id ffacd0b85a97d-378c2cfb3b7mr14362544f8f.13.1726740626098; Thu, 19 Sep 2024 03:10:26 -0700 (PDT) Received: from LAPTOP-0FHSM1V0.criticaltechworks.com ([78.137.195.161]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378e7805193sm14561716f8f.98.2024.09.19.03.10.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Sep 2024 03:10:25 -0700 (PDT) From: Pedro Ferreira To: openembedded-core@lists.openembedded.org Cc: Pedro Ferreira , Pedro Silva Ferreira , Richard Purdie Subject: [scarthgap][PATCH v3 1/3] buildhistory: Fix intermittent package file list creation Date: Thu, 19 Sep 2024 11:10:18 +0100 Message-Id: <20240919101020.2858204-1-pmi183@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 19 Sep 2024 10:10:32 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/204667 From: Pedro Ferreira The directory that buildhistory_list_pkg_files writes to during do_package is created by do_packagedata so a clean buildhistory doesn't have files-in-package written during the first build since packagedata happens after do_package. Ensure the output package folder is created to avoid missing files-in-package.txt files. Also it ensures that in case of `find` fails we leave with a hard error instead of hiding the error on the for loop. Signed-off-by: Pedro Silva Ferreira Signed-off-by: Richard Purdie (cherry picked from commit 8de9b8c1e199896b9a7bc5ed64967c6bfbf84bea) --- meta/classes/buildhistory.bbclass | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass index fd53e92402..d219519f86 100644 --- a/meta/classes/buildhistory.bbclass +++ b/meta/classes/buildhistory.bbclass @@ -599,15 +599,12 @@ buildhistory_list_files_no_owners() { buildhistory_list_pkg_files() { # Create individual files-in-package for each recipe's package - for pkgdir in $(find ${PKGDEST}/* -maxdepth 0 -type d); do + pkgdirlist=$(find ${PKGDEST}/* -maxdepth 0 -type d) + for pkgdir in $pkgdirlist; do pkgname=$(basename $pkgdir) outfolder="${BUILDHISTORY_DIR_PACKAGE}/$pkgname" outfile="$outfolder/files-in-package.txt" - # Make sure the output folder exists so we can create the file - if [ ! -d $outfolder ] ; then - bbdebug 2 "Folder $outfolder does not exist, file $outfile not created" - continue - fi + mkdir -p $outfolder buildhistory_list_files $pkgdir $outfile fakeroot done } From patchwork Thu Sep 19 10:10:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Ferreira X-Patchwork-Id: 49296 X-Patchwork-Delegate: steve@sakoman.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 339D8CE8D73 for ; Thu, 19 Sep 2024 10:10:32 +0000 (UTC) Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by mx.groups.io with SMTP id smtpd.web11.16171.1726740629084269134 for ; Thu, 19 Sep 2024 03:10:29 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=AgsFSMqN; spf=pass (domain: gmail.com, ip: 209.85.221.44, mailfrom: pmi183@gmail.com) Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-374d29ad8a7so423491f8f.2 for ; Thu, 19 Sep 2024 03:10:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726740627; x=1727345427; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gKhJTubu2tcNflzvyHAs0xIDcWSE4gGAqa9cBhsYLE8=; b=AgsFSMqNqJO5w9Sks3+0WfIBAgJjAuDxVRJVT+trovTOUFfHtMWpawEUqtGYouhXip wFcqIAU5b2lOkrG+BC/KO4mFQvvLuHlQhu0Ol8VbBgikk6pyToDF8zHCfkEbMpmrvDb8 r357d9uUTaBf1gGHWFbz5tu/hhEDXnIkBjd21QVHHx8nipDPWTcVGDYM3OytnJBtXrU1 FKAvDeE9gmnoeK4NebVslyq+HfEmgN1Y58WgEjLXx5EVS3FSczk2LPfz3zfVPkqjmvnU jE/WFFSF46LdrZ0oq5unTFV0IIvujjL2CSCaPPx0crvyWHn1XTw1hzlQqZ6GJp9ac2hM wshg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726740627; x=1727345427; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gKhJTubu2tcNflzvyHAs0xIDcWSE4gGAqa9cBhsYLE8=; b=vCEiM15GZnOOcTc/fAtJQgsCGw2i62527YeF6lOyxOsJFYafJ1L+g9FFxhEh8WKQXd fAxSx4bBIsY/JYFs1WSn7YKfm+SS9iIqGd0jl1xNnT3Pz/Ch1irPd9iuTfQEyCcW49PS Oll7kcyKIh+D6zam1YPSkO1qchnl1zDdgBfHy6YI76r/aBh7vknccABQ8QqKu0am+qZ7 tFQ8WXBhR5tX4ZLKq5BM0B/ze+y+jNECxqQHMJ5OJnUiDyfNVflAUI3hhZ5ajuKQMoPy YL1Ye1bUGfL+TmJtU8csfJ7tey7Jf2OguNmQcgidbuUMuKp4CzwJs3/JG1m9nYfUT4g2 zXgA== X-Gm-Message-State: AOJu0Yxd0JFlMCIIHpZaC73jp95VYu/+qrd1elmYmSu8el1VoxnDLVg1 E7fVRicBH/eNb/9XN5+wDKKNKECBk1LebNiau9WNIXv2wiBefQnSCgN2GHp5 X-Google-Smtp-Source: AGHT+IGQr53xQebElhQxaD38CR0nD7+zpRx0rRlf7y+M2EvUrTVRbm07W5QfHOuE6+DQi/vxa6qhew== X-Received: by 2002:adf:e111:0:b0:368:74c0:6721 with SMTP id ffacd0b85a97d-378c2d5163dmr14106590f8f.38.1726740627206; Thu, 19 Sep 2024 03:10:27 -0700 (PDT) Received: from LAPTOP-0FHSM1V0.criticaltechworks.com ([78.137.195.161]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378e7805193sm14561716f8f.98.2024.09.19.03.10.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Sep 2024 03:10:26 -0700 (PDT) From: Pedro Ferreira To: openembedded-core@lists.openembedded.org Cc: Pedro Ferreira , Pedro Ferreira , Richard Purdie Subject: [scarthgap][PATCH v3 2/3] buildhistory: Restoring files from preserve list Date: Thu, 19 Sep 2024 11:10:19 +0100 Message-Id: <20240919101020.2858204-2-pmi183@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240919101020.2858204-1-pmi183@gmail.com> References: <20240919101020.2858204-1-pmi183@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 19 Sep 2024 10:10:32 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/204668 From: Pedro Ferreira This fix will ensure that, when we activate feature `BUILDHISTORY_RESET`, files marked to keep on feature `BUILDHISTORY_PRESERVE` will indeed exist is buildhistory final path since they are moved to buildhistory/old but not restored at any point. Signed-off-by: Pedro Ferreira Signed-off-by: Richard Purdie (cherry picked from commit 9f68a45aa238ae5fcdfaca71ba0e7015e9cb720e) --- meta/classes/buildhistory.bbclass | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass index d219519f86..08970aafea 100644 --- a/meta/classes/buildhistory.bbclass +++ b/meta/classes/buildhistory.bbclass @@ -110,6 +110,7 @@ python buildhistory_emit_pkghistory() { import json import shlex import errno + import shutil pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE') oldpkghistdir = d.getVar('BUILDHISTORY_OLD_DIR_PACKAGE') @@ -223,6 +224,20 @@ python buildhistory_emit_pkghistory() { items.sort() return ' '.join(items) + def preservebuildhistoryfiles(pkg, preserve): + if os.path.exists(os.path.join(oldpkghistdir, pkg)): + listofobjs = os.listdir(os.path.join(oldpkghistdir, pkg)) + for obj in listofobjs: + if obj not in preserve: + continue + try: + bb.utils.mkdirhier(os.path.join(pkghistdir, pkg)) + shutil.copyfile(os.path.join(oldpkghistdir, pkg, obj), os.path.join(pkghistdir, pkg, obj)) + except IOError as e: + bb.note("Unable to copy file. %s" % e) + except EnvironmentError as e: + bb.note("Unable to copy file. %s" % e) + pn = d.getVar('PN') pe = d.getVar('PE') or "0" pv = d.getVar('PV') @@ -250,6 +265,14 @@ python buildhistory_emit_pkghistory() { if not os.path.exists(pkghistdir): bb.utils.mkdirhier(pkghistdir) else: + # We need to make sure that all files kept in + # buildhistory/old are restored successfully + # otherwise next block of code wont have files to + # check and purge + if d.getVar("BUILDHISTORY_RESET"): + for pkg in packagelist: + preservebuildhistoryfiles(pkg, preserve) + # Remove files for packages that no longer exist for item in os.listdir(pkghistdir): if item not in preserve: From patchwork Thu Sep 19 10:10:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Ferreira X-Patchwork-Id: 49295 X-Patchwork-Delegate: steve@sakoman.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32CF1CE8D6E for ; Thu, 19 Sep 2024 10:10:32 +0000 (UTC) Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) by mx.groups.io with SMTP id smtpd.web11.16172.1726740630059991033 for ; Thu, 19 Sep 2024 03:10:30 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Op4x3iAT; spf=pass (domain: gmail.com, ip: 209.85.221.47, mailfrom: pmi183@gmail.com) Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-374c6187b6eso376939f8f.0 for ; Thu, 19 Sep 2024 03:10:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726740628; x=1727345428; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LUTrk3qIyFABeMP99l5bBd4fQiQcm41OjwIo5qXzeh0=; b=Op4x3iATLLUz8P6chZcDMMxEobNcyOBX2rJ6MSGGYOrsfxSYa7XyH1W+GO5QAAJm5/ BwBM1FdDg/0HLg5wh2KyjhJIYL8OEEvWfYlVy7VHTFvdG3px8a7sULWF43MtLkEGOcva L2FFMzTpa+tvPz1hL5c4oSETcXU76iWAguugNNKOcaubOsOz93Z7ajJPeU9lCwj2oESN gWnK9OM0RDwUs3K4bSjbZxIati3o2QNN8gk7aasc0tRJV0n2LWWIi3Y+JDdERcPVcPoD 1IgXNwD2WuOtYKtIqUVYc5zNDXf5q3UVRZgIiuNPlqVcrJEu2sFoFuHSeFSzWIBmuzNq jZ3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726740628; x=1727345428; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LUTrk3qIyFABeMP99l5bBd4fQiQcm41OjwIo5qXzeh0=; b=fmfGGAo1QvO56xdoB+DvLuBTCxuqi12tsrVeZtlTJRMYmi24gCAwL5aEUIITY2H9uR Hjq3c0qJ7+nbzCqfuu5P6FwTf2QlgGN8ZuucweEqmZKeddm8yNiwLC9WL9VTvOncAZuZ lKbAD6ZyqXJJ/T/gDg9e8JQk0f8BSKGpSb0Fe3MGFoiWiN/SsW65gvd0Z1+EzcDBpm8+ fVCkQ+bh/yK5IoP5ag6feIT9kzpkklIORAQUlsfJc2+Q7Z7bGBmmqo8kPwXMi0jIsDxv xMOZkguvGlfs4ldYkRFNMET4o+F3JgNyST+jXVIe+vtp1l3k/8cR/pc7x5YXy++RXOT1 nrUQ== X-Gm-Message-State: AOJu0Yzy1I6ILjczY9351DqTApzcc0qZue0VT6T8NiNbSEVSwNqTwESq DTujlTVAGpxI9ZMFstq0nKMGYzzNNLGGfsdBVrZ9SaK8gtIe92bYCwGZZg== X-Google-Smtp-Source: AGHT+IEIXE0RX2su3QeNeFI0hFbJD3q6JC/BdDoVeKm985nsES0XYPqlxCyxA2S9jA29Lf8hIPvfpg== X-Received: by 2002:adf:cd8b:0:b0:371:8cc3:3995 with SMTP id ffacd0b85a97d-378c2d12497mr15257955f8f.34.1726740628298; Thu, 19 Sep 2024 03:10:28 -0700 (PDT) Received: from LAPTOP-0FHSM1V0.criticaltechworks.com ([78.137.195.161]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378e7805193sm14561716f8f.98.2024.09.19.03.10.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Sep 2024 03:10:27 -0700 (PDT) From: Pedro Ferreira To: openembedded-core@lists.openembedded.org Cc: Richard Purdie Subject: [scarthgap][PATCH v3 3/3] buildhistory: Simplify intercept call sites and drop SSTATEPOSTINSTFUNC usage Date: Thu, 19 Sep 2024 11:10:20 +0100 Message-Id: <20240919101020.2858204-3-pmi183@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240919101020.2858204-1-pmi183@gmail.com> References: <20240919101020.2858204-1-pmi183@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 19 Sep 2024 10:10:32 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/204669 From: Richard Purdie We planned to drop SSTATEPOSTINSTFUNC some time ago with the introduction of postfuncs. Finally get around to doing that which should make the buildhistory code a little more readable. Unfortunately ordering the buildhistory function calls after the sstate ones is difficult without coding that into the sstate class. This patch does that to ensure everything functions as expected until we can find a better way. This is still likely preferable than the generic sstate postfuncs support since the function flow is much more readable. Signed-off-by: Richard Purdie (cherry picked from commit c9e2a8fa2f0305ef1247ec405555612326f798f8) --- meta/classes-global/sstate.bbclass | 5 +++- 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 76a7b59636..93df5fa9e6 100644 --- a/meta/classes-global/sstate.bbclass +++ b/meta/classes-global/sstate.bbclass @@ -161,7 +161,10 @@ python () { d.setVar('SSTATETASKS', " ".join(unique_tasks)) for task in unique_tasks: d.prependVarFlag(task, 'prefuncs', "sstate_task_prefunc ") - d.appendVarFlag(task, 'postfuncs', " sstate_task_postfunc") + # Generally sstate should be last, execpt for buildhistory functions + postfuncs = (d.getVarFlag(task, 'postfuncs') or "").split() + newpostfuncs = [p for p in postfuncs if "buildhistory" not in p] + ["sstate_task_postfunc"] + [p for p in postfuncs if "buildhistory" in p] + d.setVarFlag(task, 'postfuncs', " ".join(newpostfuncs)) d.setVarFlag(task, 'network', '1') d.setVarFlag(task + "_setscene", 'network', '1') } diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass index 08970aafea..0b1bd518fe 100644 --- a/meta/classes/buildhistory.bbclass +++ b/meta/classes/buildhistory.bbclass @@ -47,11 +47,18 @@ BUILDHISTORY_PUSH_REPO ?= "" BUILDHISTORY_TAG ?= "build" BUILDHISTORY_PATH_PREFIX_STRIP ?= "" -SSTATEPOSTINSTFUNCS:append = " buildhistory_emit_pkghistory" -# We want to avoid influencing the signatures of sstate tasks - first the function itself: -sstate_install[vardepsexclude] += "buildhistory_emit_pkghistory" -# then the value added to SSTATEPOSTINSTFUNCS: -SSTATEPOSTINSTFUNCS[vardepvalueexclude] .= "| buildhistory_emit_pkghistory" +# We want to avoid influencing the signatures of the task so use vardepsexclude +do_populate_sysroot[postfuncs] += "buildhistory_emit_sysroot" +do_populate_sysroot_setscene[postfuncs] += "buildhistory_emit_sysroot" +do_populate_sysroot[vardepsexclude] += "buildhistory_emit_sysroot" + +do_package[postfuncs] += "buildhistory_list_pkg_files" +do_package_setscene[postfuncs] += "buildhistory_list_pkg_files" +do_package[vardepsexclude] += "buildhistory_list_pkg_files" + +do_packagedata[postfuncs] += "buildhistory_emit_pkghistory" +do_packagedata_setscene[postfuncs] += "buildhistory_emit_pkghistory" +do_packagedata[vardepsexclude] += "buildhistory_emit_pkghistory" # Similarly for our function that gets the output signatures SSTATEPOSTUNPACKFUNCS:append = " buildhistory_emit_outputsigs" @@ -91,27 +98,15 @@ buildhistory_emit_sysroot() { # Write out metadata about this package for comparison when writing future packages # python buildhistory_emit_pkghistory() { - if d.getVar('BB_CURRENTTASK') in ['populate_sysroot', 'populate_sysroot_setscene']: - bb.build.exec_func("buildhistory_emit_sysroot", d) - return 0 - - if not "package" in (d.getVar('BUILDHISTORY_FEATURES') or "").split(): - return 0 - - if d.getVar('BB_CURRENTTASK') in ['package', 'package_setscene']: - # Create files-in-.txt files containing a list of files of each recipe's package - bb.build.exec_func("buildhistory_list_pkg_files", d) - return 0 - - if not d.getVar('BB_CURRENTTASK') in ['packagedata', 'packagedata_setscene']: - return 0 - import re import json import shlex import errno import shutil + if not "package" in (d.getVar('BUILDHISTORY_FEATURES') or "").split(): + return 0 + pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE') oldpkghistdir = d.getVar('BUILDHISTORY_OLD_DIR_PACKAGE') @@ -621,6 +616,10 @@ buildhistory_list_files_no_owners() { } buildhistory_list_pkg_files() { + if [ "${@bb.utils.contains('BUILDHISTORY_FEATURES', 'package', '1', '0', d)}" = "0" ] ; then + return + fi + # Create individual files-in-package for each recipe's package pkgdirlist=$(find ${PKGDEST}/* -maxdepth 0 -type d) for pkgdir in $pkgdirlist; do