blob: 15f6bf4c7d9897b1ab9546b3fe18b74075a03a1f [file] [log] [blame]
Patrick Williams73bd93f2024-02-20 08:07:48 -06001From bbc1ea3e4119c665723cfd1c5a364bc8c7cbb464 Mon Sep 17 00:00:00 2001
Andrew Geisslerdc9d6142023-05-19 09:38:37 -05002From: 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
Patrick Williams73bd93f2024-02-20 08:07:48 -060034index 48d7e05..4a5e35c 100755
Andrew Geisslerdc9d6142023-05-19 09:38:37 -050035--- 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
Patrick Williams73bd93f2024-02-20 08:07:48 -060042 # Generate version information for rpicam-apps