All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] oe-pkgdata-util: Check if environment script is initialized
@ 2021-02-01 14:46 Dorinda
  2021-02-08  0:02 ` Dorinda
  2021-02-08 16:42 ` [OE-core] " Richard Purdie
  0 siblings, 2 replies; 4+ messages in thread
From: Dorinda @ 2021-02-01 14:46 UTC (permalink / raw)
  To: openembedded-core; +Cc: dorindabassey

Tinfoil doesn't behave well if environment is not initialized, this check ensures a proper error log if environment is not initialized.

[YOCTO #12096]

Signed-off-by: Dorinda Bassey <dorindabassey@gmail.com>
---
v2:
-Positioned check under a condition when it cannot determine the pkgdata_dir

 scripts/oe-pkgdata-util | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/scripts/oe-pkgdata-util b/scripts/oe-pkgdata-util
index 93220e3617..75dd23efa3 100755
--- a/scripts/oe-pkgdata-util
+++ b/scripts/oe-pkgdata-util
@@ -598,6 +598,9 @@ def main():
             logger.error("Unable to find bitbake by searching parent directory of this script or PATH")
             sys.exit(1)
         logger.debug('Found bitbake path: %s' % bitbakepath)
+        if not os.environ.get('BUILDDIR', ''):
+            logger.error("This script can only be run after initialising the build environment (e.g. by using oe-init-build-env)")
+            sys.exit(1)
         tinfoil = tinfoil_init()
         try:
             args.pkgdata_dir = tinfoil.config_data.getVar('PKGDATA_DIR')
-- 
2.17.1


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

* Re: [PATCH v2] oe-pkgdata-util: Check if environment script is initialized
  2021-02-01 14:46 [PATCH v2] oe-pkgdata-util: Check if environment script is initialized Dorinda
@ 2021-02-08  0:02 ` Dorinda
  2021-02-08 16:42 ` [OE-core] " Richard Purdie
  1 sibling, 0 replies; 4+ messages in thread
From: Dorinda @ 2021-02-08  0:02 UTC (permalink / raw)
  To: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 1341 bytes --]

Hi Everyone,
Just a friendly reminder to review this patch.

Thanks,
Dorinda.

On Feb 1, 2021 3:46 PM, "dorindabassey" <dorindabassey@gmail.com> wrote:

> Tinfoil doesn't behave well if environment is not initialized, this check
> ensures a proper error log if environment is not initialized.
>
> [YOCTO #12096]
>
> Signed-off-by: Dorinda Bassey <dorindabassey@gmail.com>
> ---
> v2:
> -Positioned check under a condition when it cannot determine the
> pkgdata_dir
>
>  scripts/oe-pkgdata-util | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/scripts/oe-pkgdata-util b/scripts/oe-pkgdata-util
> index 93220e3617..75dd23efa3 100755
> --- a/scripts/oe-pkgdata-util
> +++ b/scripts/oe-pkgdata-util
> @@ -598,6 +598,9 @@ def main():
>              logger.error("Unable to find bitbake by searching parent
> directory of this script or PATH")
>              sys.exit(1)
>          logger.debug('Found bitbake path: %s' % bitbakepath)
> +        if not os.environ.get('BUILDDIR', ''):
> +            logger.error("This script can only be run after initialising
> the build environment (e.g. by using oe-init-build-env)")
> +            sys.exit(1)
>          tinfoil = tinfoil_init()
>          try:
>              args.pkgdata_dir = tinfoil.config_data.getVar('PKGDATA_DIR')
> --
> 2.17.1
>
>

[-- Attachment #2: Type: text/html, Size: 1937 bytes --]

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

* Re: [OE-core] [PATCH v2] oe-pkgdata-util: Check if environment script is initialized
  2021-02-01 14:46 [PATCH v2] oe-pkgdata-util: Check if environment script is initialized Dorinda
  2021-02-08  0:02 ` Dorinda
@ 2021-02-08 16:42 ` Richard Purdie
  2021-02-09  1:13   ` Dorinda
  1 sibling, 1 reply; 4+ messages in thread
From: Richard Purdie @ 2021-02-08 16:42 UTC (permalink / raw)
  To: Dorinda, openembedded-core

Hi Dorinda,

On Mon, 2021-02-01 at 09:46 -0500, Dorinda wrote:
> Tinfoil doesn't behave well if environment is not initialized, this check ensures a proper error log if environment is not initialized.
> 
> [YOCTO #12096]
> 
> Signed-off-by: Dorinda Bassey <dorindabassey@gmail.com>
> ---
> v2:
> -Positioned check under a condition when it cannot determine the pkgdata_dir
> 
>  scripts/oe-pkgdata-util | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/scripts/oe-pkgdata-util b/scripts/oe-pkgdata-util
> index 93220e3617..75dd23efa3 100755
> --- a/scripts/oe-pkgdata-util
> +++ b/scripts/oe-pkgdata-util
> @@ -598,6 +598,9 @@ def main():
>              logger.error("Unable to find bitbake by searching parent directory of this script or PATH")
>              sys.exit(1)
>          logger.debug('Found bitbake path: %s' % bitbakepath)
> +        if not os.environ.get('BUILDDIR', ''):
> +            logger.error("This script can only be run after initialising the build environment (e.g. by using oe-init-build-env)")
> +            sys.exit(1)
>          tinfoil = tinfoil_init()
>          try:
>              args.pkgdata_dir = tinfoil.config_data.getVar('PKGDATA_DIR')

I'm a little worried about this patch since it fixes the oe-pkgdata-
util case but what about devtool, or recipetool or anything else which
uses tinfoil.

I'm wondering if there should be a check inside tinfoil itself?

or is this problem really oe-pkgdata-util specific?

Cheers,

Richard


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

* Re: [OE-core] [PATCH v2] oe-pkgdata-util: Check if environment script is initialized
  2021-02-08 16:42 ` [OE-core] " Richard Purdie
@ 2021-02-09  1:13   ` Dorinda
  0 siblings, 0 replies; 4+ messages in thread
From: Dorinda @ 2021-02-09  1:13 UTC (permalink / raw)
  To: Richard Purdie; +Cc: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 1907 bytes --]

Hi Richard,

I checked devtool and recipetool, they have checks in place that errors out
immediately if executed without initializing oe-init-build-env script.

However, I'm unsure about this:
I'm wondering if there should be a check inside tinfoil itself?

Thanks and Regards,
Dorinda.


On Feb 8, 2021 17:42, "Richard Purdie" <richard.purdie@linuxfoundation.org>
wrote:

Hi Dorinda,

On Mon, 2021-02-01 at 09:46 -0500, Dorinda wrote:
> Tinfoil doesn't behave well if environment is not initialized, this check
ensures a proper error log if environment is not initialized.
>
> [YOCTO #12096]
>
> Signed-off-by: Dorinda Bassey <dorindabassey@gmail.com>
> ---
> v2:
> -Positioned check under a condition when it cannot determine the
pkgdata_dir
>
>  scripts/oe-pkgdata-util | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/scripts/oe-pkgdata-util b/scripts/oe-pkgdata-util
> index 93220e3617..75dd23efa3 100755
> --- a/scripts/oe-pkgdata-util
> +++ b/scripts/oe-pkgdata-util
> @@ -598,6 +598,9 @@ def main():
>              logger.error("Unable to find bitbake by searching parent
directory of this script or PATH")
>              sys.exit(1)
>          logger.debug('Found bitbake path: %s' % bitbakepath)
> +        if not os.environ.get('BUILDDIR', ''):
> +            logger.error("This script can only be run after initialising
the build environment (e.g. by using oe-init-build-env)")
> +            sys.exit(1)
>          tinfoil = tinfoil_init()
>          try:
>              args.pkgdata_dir = tinfoil.config_data.getVar('PKGDATA_DIR')

I'm a little worried about this patch since it fixes the oe-pkgdata-
util case but what about devtool, or recipetool or anything else which
uses tinfoil.

I'm wondering if there should be a check inside tinfoil itself?

or is this problem really oe-pkgdata-util specific?

Cheers,

Richard

[-- Attachment #2: Type: text/html, Size: 2935 bytes --]

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

end of thread, other threads:[~2021-02-09  1:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-01 14:46 [PATCH v2] oe-pkgdata-util: Check if environment script is initialized Dorinda
2021-02-08  0:02 ` Dorinda
2021-02-08 16:42 ` [OE-core] " Richard Purdie
2021-02-09  1:13   ` Dorinda

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.