All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] devtool: Compare abspath of both B and S
@ 2017-05-30 10:16 Ola x Nilsson
  2017-05-30 21:45 ` Paul Eggleton
  0 siblings, 1 reply; 2+ messages in thread
From: Ola x Nilsson @ 2017-05-30 10:16 UTC (permalink / raw)
  To: openembedded-core

Either both or none of the paths must be passed through
os.path.abspath or things like 'A//B', 'A/./B/', and 'A/B/' in S will
cause unintentional mismatches even when B = "${S}".

Using os.path.abspath for both seems more likely to be correct as that
will also handle the case where ${B} != ${S} but the abspaths are
equal.

Signed-off-by: Ola x Nilsson <olani@axis.com>
---
 scripts/lib/devtool/__init__.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py
index d646b0cf63..29c4c05071 100644
--- a/scripts/lib/devtool/__init__.py
+++ b/scripts/lib/devtool/__init__.py
@@ -191,7 +191,7 @@ def use_external_build(same_dir, no_same_dir, d):
         logger.info('Using source tree as build directory since --same-dir specified')
     elif bb.data.inherits_class('autotools-brokensep', d):
         logger.info('Using source tree as build directory since recipe inherits autotools-brokensep')
-    elif d.getVar('B') == os.path.abspath(d.getVar('S')):
+    elif os.path.abspath(d.getVar('B')) == os.path.abspath(d.getVar('S')):
         logger.info('Using source tree as build directory since that would be the default for this recipe')
     else:
         b_is_s = False
-- 
2.11.0



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

* Re: [PATCH] devtool: Compare abspath of both B and S
  2017-05-30 10:16 [PATCH] devtool: Compare abspath of both B and S Ola x Nilsson
@ 2017-05-30 21:45 ` Paul Eggleton
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Eggleton @ 2017-05-30 21:45 UTC (permalink / raw)
  To: openembedded-core

On Tuesday, 30 May 2017 10:16:31 PM NZST Ola x Nilsson wrote:
> Either both or none of the paths must be passed through
> os.path.abspath or things like 'A//B', 'A/./B/', and 'A/B/' in S will
> cause unintentional mismatches even when B = "${S}".
> 
> Using os.path.abspath for both seems more likely to be correct as that
> will also handle the case where ${B} != ${S} but the abspaths are
> equal.
> 
> Signed-off-by: Ola x Nilsson <olani@axis.com>
> ---
>  scripts/lib/devtool/__init__.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/
__init__.py
> index d646b0cf63..29c4c05071 100644
> --- a/scripts/lib/devtool/__init__.py
> +++ b/scripts/lib/devtool/__init__.py
> @@ -191,7 +191,7 @@ def use_external_build(same_dir, no_same_dir, d):
>          logger.info('Using source tree as build directory since --same-dir 
specified')
>      elif bb.data.inherits_class('autotools-brokensep', d):
>          logger.info('Using source tree as build directory since recipe 
inherits autotools-brokensep')
> -    elif d.getVar('B') == os.path.abspath(d.getVar('S')):
> +    elif os.path.abspath(d.getVar('B')) == os.path.abspath(d.getVar('S')):
>          logger.info('Using source tree as build directory since that would 
be the default for this recipe')
>      else:
>          b_is_s = False
> 

Acked-by: Paul Eggleton <paul.eggleton@linux.intel.com>

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre


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

end of thread, other threads:[~2017-05-30 21:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-30 10:16 [PATCH] devtool: Compare abspath of both B and S Ola x Nilsson
2017-05-30 21:45 ` Paul Eggleton

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.