From: Uladzimir Bely <ubely@ilbers.de>
To: isar-users@googlegroups.com
Subject: [PATCH v2 1/1] Avoid line duplicates when appended from the recipes
Date: Wed, 23 Feb 2022 07:05:18 +0100 [thread overview]
Message-ID: <20220223060518.11847-2-ubely@ilbers.de> (raw)
In-Reply-To: <20220223060518.11847-1-ubely@ilbers.de>
Potentially, using "cat << EOF >> target_file" can lead to duplicated
lines in the target files.
This adds simple checks for skipping lines append if they already exist.
Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
meta-isar/recipes-bsp/optee-os/optee-os-stm32mp15x_3.11.0.bb | 3 ++-
meta-isar/recipes-kernel/linux/linux-mainline_5.4.70.bb | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/meta-isar/recipes-bsp/optee-os/optee-os-stm32mp15x_3.11.0.bb b/meta-isar/recipes-bsp/optee-os/optee-os-stm32mp15x_3.11.0.bb
index 9c0efaf1..8436dcbd 100644
--- a/meta-isar/recipes-bsp/optee-os/optee-os-stm32mp15x_3.11.0.bb
+++ b/meta-isar/recipes-bsp/optee-os/optee-os-stm32mp15x_3.11.0.bb
@@ -21,7 +21,8 @@ OPTEE_BINARIES = "tee-header_v2.stm32 tee-pageable_v2.stm32 tee-pager_v2.stm32"
# Set version manually to PV, the tarball does not contain any hint.
# Alternative: pull from git and add git as build dependency.
dpkg_runbuild_prepend() {
- cat << EOF >> ${S}/debian/rules
+ grep -q "^export TEE_IMPL_VERSION" ${S}/debian/rules ||
+ cat << EOF >> ${S}/debian/rules
export TEE_IMPL_VERSION=${PV}
EOF
diff --git a/meta-isar/recipes-kernel/linux/linux-mainline_5.4.70.bb b/meta-isar/recipes-kernel/linux/linux-mainline_5.4.70.bb
index 28e51c0d..644535e8 100644
--- a/meta-isar/recipes-kernel/linux/linux-mainline_5.4.70.bb
+++ b/meta-isar/recipes-kernel/linux/linux-mainline_5.4.70.bb
@@ -25,7 +25,8 @@ LINUX_VERSION_EXTENSION = "-isar"
# For testing purposes only
dpkg_configure_kernel_append() {
-cat << EOF | sed -i '/^override_dh_auto_build/ r /dev/stdin' ${S}/debian/rules
+ grep -q "# CONFIG_MTD is not set" ${S}/debian/rules ||
+ cat << EOF | sed -i '/^override_dh_auto_build/ r /dev/stdin' ${S}/debian/rules
if ! grep "# CONFIG_MTD is not set" \$(O)/.config && \\
! grep "# CONFIG_MTD_UBI is not set" \$(O)/.config; then \\
grep "# CONFIG_UBIFS_FS is not set" \$(O)/.config || \\
--
2.20.1
next prev parent reply other threads:[~2022-02-23 6:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-23 6:05 [PATCH v2 0/1] " Uladzimir Bely
2022-02-23 6:05 ` Uladzimir Bely [this message]
2022-03-03 10:22 ` Anton Mikanovich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220223060518.11847-2-ubely@ilbers.de \
--to=ubely@ilbers.de \
--cc=isar-users@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox