diff mbox

base.bbclass: ensure HOSTTOOLS links point to executables

Message ID 1490880850-30814-1-git-send-email-ross.burton@intel.com
State Accepted
Commit 7f40c934c3aeb1d34f95f30b281e25a17c428fce
Headers show

Commit Message

Ross Burton March 30, 2017, 1:34 p.m. UTC
Use the new executable argument to bb.utils.which() to ensure that the symlinks
point to executable files and not for example directories with the right name
which happened to be on $PATH.

[ YOCTO #11256 ]

Signed-off-by: Ross Burton <ross.burton@intel.com>

---
 meta/classes/base.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.8.1

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Comments

Martin Jansa March 30, 2017, 3:14 p.m. UTC | #1
Shouldn't this bump required bitbake version?

On Thu, Mar 30, 2017 at 3:34 PM, Ross Burton <ross.burton@intel.com> wrote:

> Use the new executable argument to bb.utils.which() to ensure that the

> symlinks

> point to executable files and not for example directories with the right

> name

> which happened to be on $PATH.

>

> [ YOCTO #11256 ]

>

> Signed-off-by: Ross Burton <ross.burton@intel.com>

> ---

>  meta/classes/base.bbclass | 4 ++--

>  1 file changed, 2 insertions(+), 2 deletions(-)

>

> diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass

> index cf8748a..e29821f 100644

> --- a/meta/classes/base.bbclass

> +++ b/meta/classes/base.bbclass

> @@ -128,9 +128,9 @@ def setup_hosttools_dir(dest, toolsvar, d, fatal=True):

>      for tool in tools:

>          desttool = os.path.join(dest, tool)

>          if not os.path.exists(desttool):

> -            srctool = bb.utils.which(path, tool)

> +            srctool = bb.utils.which(path, tool, executable=True)

>              if "ccache" in srctool:

> -                srctool = bb.utils.which(path, tool, direction=1)

> +                srctool = bb.utils.which(path, tool, executable=True,

> direction=1)

>              if srctool:

>                  os.symlink(srctool, desttool)

>              else:

> --

> 2.8.1

>

> --

> _______________________________________________

> Openembedded-core mailing list

> Openembedded-core@lists.openembedded.org

> http://lists.openembedded.org/mailman/listinfo/openembedded-core

>
-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Ross Burton March 30, 2017, 3:16 p.m. UTC | #2
On 30 March 2017 at 16:14, Martin Jansa <martin.jansa@gmail.com> wrote:

> Shouldn't this bump required bitbake version?

>


Yes, there needs to be a corresponding version bump.

I'm hoping that we can re-order/stall to avoid bumping too many times
during M4.

Ross
-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
diff mbox

Patch

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index cf8748a..e29821f 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -128,9 +128,9 @@  def setup_hosttools_dir(dest, toolsvar, d, fatal=True):
     for tool in tools:
         desttool = os.path.join(dest, tool)
         if not os.path.exists(desttool):
-            srctool = bb.utils.which(path, tool)
+            srctool = bb.utils.which(path, tool, executable=True)
             if "ccache" in srctool:
-                srctool = bb.utils.which(path, tool, direction=1)
+                srctool = bb.utils.which(path, tool, executable=True, direction=1)
             if srctool:
                 os.symlink(srctool, desttool)
             else: