Andrew Geissler | dc9d614 | 2023-05-19 09:38:37 -0500 | [diff] [blame] | 1 | From 738f530829fb5ee37d74191d34f75d72921284ca Mon Sep 17 00:00:00 2001 |
| 2 | From: Martin Jansa <Martin.Jansa@gmail.com> |
| 3 | Date: Thu, 4 May 2023 18:07:16 +0000 |
| 4 | Subject: [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: |
| 8 | Traceback (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: |
| 13 | TypeError: __init__() got an unexpected keyword argument 'text' |
| 14 | |
| 15 | During handling of the above exception, another exception occurred: |
| 16 | |
| 17 | Traceback (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="") |
| 22 | UnboundLocalError: local variable 'commit' referenced before assignment |
| 23 | Generating version string: |
| 24 | |
| 25 | even when newer python3 is in PATH (either from buildtools or from python3native) |
| 26 | |
| 27 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> |
| 28 | Upstream-Status: Pending |
| 29 | --- |
| 30 | utils/version.py | 2 +- |
| 31 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 32 | |
| 33 | diff --git a/utils/version.py b/utils/version.py |
| 34 | index 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 |