public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Henning Schild <henning.schild@siemens.com>
To: Uladzimir Bely <ubely@ilbers.de>
Cc: isar-users@googlegroups.com
Subject: Re: [PATCH] Avoid line duplicates when appended from the recipes
Date: Tue, 22 Feb 2022 16:59:30 +0100	[thread overview]
Message-ID: <20220222165930.2e5605b0@md1za8fc.ad001.siemens.net> (raw)
In-Reply-To: <20220222135209.13724-1-ubely@ilbers.de>

Am Tue, 22 Feb 2022 14:52:09 +0100
schrieb Uladzimir Bely <ubely@ilbers.de>:

> From: WiseLord <wiselord1983@gmail.com>
> 
> Potentially, using "cat << EOF >> target_file" can kead to duplicated
> lines in the target files.
> 
> This adds simple checks for skipping lines append if they already
> exist.
> 
> Signed-off-by: WiseLord <wiselord1983@gmail.com>
> ---
>  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

this is a single line append, i guess a simple echo instead of a "cat
<< EOF >> " would be more readable.
If you agree you could put that on top in another patch

grep -q ...
  echo -e "\nTEE_IMPL_VERSION=${PV}" >> ${S}/debian/rules

probably the "-e" and "\n" are not even needed

Henning

>  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 || \\


  reply	other threads:[~2022-02-22 15:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-22 13:52 Uladzimir Bely
2022-02-22 15:59 ` Henning Schild [this message]
2022-02-22 16:05 ` Jan Kiszka
2022-02-23  6:13   ` Uladzimir Bely

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=20220222165930.2e5605b0@md1za8fc.ad001.siemens.net \
    --to=henning.schild@siemens.com \
    --cc=isar-users@googlegroups.com \
    --cc=ubely@ilbers.de \
    /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