blob: 4c066dee382ea302bd75a40906fb973233da6ba7 [file] [log] [blame]
Andrew Geisslerdc9d6142023-05-19 09:38:37 -05001From 738f530829fb5ee37d74191d34f75d72921284ca Mon Sep 17 00:00:00 2001
2From: Martin Jansa <Martin.Jansa@gmail.com>
3Date: Thu, 4 May 2023 18:07:16 +0000
4Subject: [PATCH] utils/version.py: use /usr/bin/env in shebang
5
6* it uses subprocess text=True which is available only since python-3.7
7 when running on host with python-3.6 it fails with:
8Traceback (most recent call last):
9 File "TOPDIR/BUILD/work/raspberrypi4_64-oe-linux/rpi-libcamera-apps/git-r0/git/utils/version.py", line 19, in generate_version
10 stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, text=True)
11 File "/usr/lib/python3.6/subprocess.py", line 423, in run
12 with Popen(*popenargs, **kwargs) as process:
13TypeError: __init__() got an unexpected keyword argument 'text'
14
15During handling of the above exception, another exception occurred:
16
17Traceback (most recent call last):
18 File "TOPDIR/BUILD/work/raspberrypi4_64-oe-linux/rpi-libcamera-apps/git-r0/git/utils/version.py", line 52, in <module>
19 generate_version()
20 File "TOPDIR/BUILD/work/raspberrypi4_64-oe-linux/rpi-libcamera-apps/git-r0/git/utils/version.py", line 48, in generate_version
21 print(f'{commit} {datetime.now().strftime("%d-%m-%Y (%H:%M:%S)")}', end="")
22UnboundLocalError: local variable 'commit' referenced before assignment
23Generating version string:
24
25 even when newer python3 is in PATH (either from buildtools or from python3native)
26
27Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
28Upstream-Status: Pending
29---
30 utils/version.py | 2 +-
31 1 file changed, 1 insertion(+), 1 deletion(-)
32
33diff --git a/utils/version.py b/utils/version.py
34index fc2d431..1400eed 100755
35--- a/utils/version.py
36+++ b/utils/version.py
37@@ -1,4 +1,4 @@
38-#!/usr/bin/python3
39+#!/usr/bin/env python3
40
41 # Copyright (C) 2021, Raspberry Pi (Trading) Limited
42 # Generate version information for libcamera-apps