public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "'Jan Kiszka' via isar-users" <isar-users@googlegroups.com>
To: Tobias Schaffner <tobias.schaffner@siemens.com>,
	isar-users@googlegroups.com
Subject: Re: [PATCH v2] meta: Do not warn on usage of env vars exported to bb fetcher
Date: Tue, 3 Sep 2024 21:51:17 +0200	[thread overview]
Message-ID: <1017e329-c599-47b3-a58c-53116cbe0f40@siemens.com> (raw)
In-Reply-To: <20240903184512.3684421-1-tobias.schaffner@siemens.com>

On 03.09.24 20:45, Tobias Schaffner wrote:
> Only a few of the variables allowed to be exported to the bitbake
> fetcher, are ignored when warning about env exports in the
> dpkg.bbclass.
> 
> Reference the list in bitbakes fetcher2 module instead of maintaining
> a additional incomplete list.
> 
> Signed-off-by: Tobias Schaffner <tobias.schaffner@siemens.com>
> ---
>  meta/classes/dpkg.bbclass | 15 +++++----------
>  1 file changed, 5 insertions(+), 10 deletions(-)
> 
> diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
> index bcc3f828..7eba7521 100644
> --- a/meta/classes/dpkg.bbclass
> +++ b/meta/classes/dpkg.bbclass
> @@ -57,7 +57,7 @@ dpkg_runbuild() {
>          value=$(echo "${line}" | cut -d '=' -f2-)
>          sbuild_export $var "$value"
>  
> -        # Don't warn some variables
> +        # Don't warn dpkg specific environment variables
>          [ "${var}" = "PARALLEL_MAKE" ] && continue
>          [ "${var}" = "CCACHE_DIR" ] && continue
>          [ "${var}" = "CCACHE_DEBUGDIR" ] && continue
> @@ -66,15 +66,10 @@ dpkg_runbuild() {
>          [ "${var}" = "PATH_PREPEND" ] && continue
>          [ "${var}" = "DEB_BUILD_OPTIONS" ] && continue
>  
> -        [ "${var}" = "http_proxy" ] && continue
> -        [ "${var}" = "HTTP_PROXY" ] && continue
> -        [ "${var}" = "https_proxy" ] && continue
> -        [ "${var}" = "HTTPS_PROXY" ] && continue
> -        [ "${var}" = "ftp_proxy" ] && continue
> -        [ "${var}" = "FTP_PROXY" ] && continue
> -        [ "${var}" = "no_proxy" ] && continue
> -        [ "${var}" = "NO_PROXY" ] && continue
> -        [ "${var}" = "GIT_PROXY_COMMAND" ] && continue
> +        # Don't warn environment variables exported to the bitbake fetcher
> +        case " ${@" ".join(bb.fetch2.FETCH_EXPORT_VARS)} " in
> +            *" ${var} "*) continue;;
> +        esac
>  
>          bbwarn "Export of '${line}' detected, please migrate to templates"
>      done

Much nicer!

Now bonus (if you like, on top) for appending the other vars that are
not part of FETCH_EXPORT_VARS to that list and reusing the shorter patch
statement for them as well. :)

Jan

-- 
Siemens AG, Technology
Linux Expert Center

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/1017e329-c599-47b3-a58c-53116cbe0f40%40siemens.com.

  reply	other threads:[~2024-09-03 19:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-03 18:45 'Tobias Schaffner' via isar-users
2024-09-03 19:51 ` 'Jan Kiszka' via isar-users [this message]
2024-09-09 14:37 ` 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=1017e329-c599-47b3-a58c-53116cbe0f40@siemens.com \
    --to=isar-users@googlegroups.com \
    --cc=jan.kiszka@siemens.com \
    --cc=tobias.schaffner@siemens.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