[libcamera-devel] libcamera: gen-controls.py: Don't hardcode path to python interpreter

Message ID 20200114114430.5910-1-laurent.pinchart@ideasonboard.com
State Accepted
Commit 055335bf49dbcb8c149bdcd4e96004c68e6b6ece
Headers show
Series
  • [libcamera-devel] libcamera: gen-controls.py: Don't hardcode path to python interpreter
Related show

Commit Message

Laurent Pinchart Jan. 14, 2020, 11:44 a.m. UTC
The gen-controls.py script hardcodes the path to the python interpreter
to /usr/bin/python3 in the first line of the script. This hardcodes
usage of the host python3, even when building in cross-compilation
environments that may ship their own version of python. Fix it by
setting the interpreter to '/usr/bin/env python3'.

Reported-by: Madhavan Krishnan <madhavan.krishnan@linaro.org>
Suggested-by: Nicolas Dufresne <nicolas@ndufresne.ca>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 src/libcamera/gen-controls.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kieran Bingham Jan. 14, 2020, 11:46 a.m. UTC | #1
Hi Laurent,

On 14/01/2020 11:44, Laurent Pinchart wrote:
> The gen-controls.py script hardcodes the path to the python interpreter
> to /usr/bin/python3 in the first line of the script. This hardcodes
> usage of the host python3, even when building in cross-compilation
> environments that may ship their own version of python. Fix it by
> setting the interpreter to '/usr/bin/env python3'.
> 
> Reported-by: Madhavan Krishnan <madhavan.krishnan@linaro.org>
> Suggested-by: Nicolas Dufresne <nicolas@ndufresne.ca>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Aha - this explains some issues I'd seen in fact.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> ---
>  src/libcamera/gen-controls.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/gen-controls.py b/src/libcamera/gen-controls.py
> index 940386cc68c8..2e5ac5c81cca 100755
> --- a/src/libcamera/gen-controls.py
> +++ b/src/libcamera/gen-controls.py
> @@ -1,4 +1,4 @@
> -#!/usr/bin/python3
> +#!/usr/bin/env python3
>  # SPDX-License-Identifier: GPL-2.0-or-later
>  # Copyright (C) 2019, Google Inc.
>  #
>

Patch

diff --git a/src/libcamera/gen-controls.py b/src/libcamera/gen-controls.py
index 940386cc68c8..2e5ac5c81cca 100755
--- a/src/libcamera/gen-controls.py
+++ b/src/libcamera/gen-controls.py
@@ -1,4 +1,4 @@ 
-#!/usr/bin/python3
+#!/usr/bin/env python3
 # SPDX-License-Identifier: GPL-2.0-or-later
 # Copyright (C) 2019, Google Inc.
 #