public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH v2] meta: Do not warn on usage of env vars exported to bb fetcher
@ 2024-09-03 18:45 'Tobias Schaffner' via isar-users
  2024-09-03 19:51 ` 'Jan Kiszka' via isar-users
  2024-09-09 14:37 ` Uladzimir Bely
  0 siblings, 2 replies; 3+ messages in thread
From: 'Tobias Schaffner' via isar-users @ 2024-09-03 18:45 UTC (permalink / raw)
  To: isar-users; +Cc: jan.kiszka, Tobias Schaffner

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

-- 
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/20240903184512.3684421-1-tobias.schaffner%40siemens.com.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] meta: Do not warn on usage of env vars exported to bb fetcher
  2024-09-03 18:45 [PATCH v2] meta: Do not warn on usage of env vars exported to bb fetcher 'Tobias Schaffner' via isar-users
@ 2024-09-03 19:51 ` 'Jan Kiszka' via isar-users
  2024-09-09 14:37 ` Uladzimir Bely
  1 sibling, 0 replies; 3+ messages in thread
From: 'Jan Kiszka' via isar-users @ 2024-09-03 19:51 UTC (permalink / raw)
  To: Tobias Schaffner, isar-users

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] meta: Do not warn on usage of env vars exported to bb fetcher
  2024-09-03 18:45 [PATCH v2] meta: Do not warn on usage of env vars exported to bb fetcher 'Tobias Schaffner' via isar-users
  2024-09-03 19:51 ` 'Jan Kiszka' via isar-users
@ 2024-09-09 14:37 ` Uladzimir Bely
  1 sibling, 0 replies; 3+ messages in thread
From: Uladzimir Bely @ 2024-09-09 14:37 UTC (permalink / raw)
  To: Tobias Schaffner, isar-users

On Tue, 2024-09-03 at 20:45 +0200, 'Tobias Schaffner' via isar-users
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
> -- 
> 2.40.1
> 

Applied to next, thanks.

-- 
Best regards,
Uladzimir.

-- 
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/78eadea702ef7cb77984d0e3a75798e4b1e6f2fe.camel%40ilbers.de.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-09-09 14:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-03 18:45 [PATCH v2] meta: Do not warn on usage of env vars exported to bb fetcher 'Tobias Schaffner' via isar-users
2024-09-03 19:51 ` 'Jan Kiszka' via isar-users
2024-09-09 14:37 ` Uladzimir Bely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox