Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkg-config.py: fix IndexError when --variable=prefix is empty (projec…
…t-chip#33288) sometimes (e.g. with openssl-3.3.0) the pkg-config returns just new-line and prefix[-4] then fails with IndexError. Fixes: Command: python3 build/config/linux/pkg-config.py -s recipe-sysroot --system_libdir lib openssl Returned 1. stderr: Traceback (most recent call last): File "build/config/linux/pkg-config.py", line 259, in <module> sys.exit(main()) ^^^^^^ File "build/config/linux/pkg-config.py", line 156, in main prefix = GetPkgConfigPrefixToStrip(options, args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "build/config/linux/pkg-config.py", line 102, in GetPkgConfigPrefixToStrip if prefix[-4] == '/usr': ~~~~~~^^^^ IndexError: string index out of range This part was originally introduced in pkg-config.py in chromium: https://chromium.googlesource.com/chromium/src/build/config/+/3df971b0a5e23e51c1c739fc1908caa1d95b8ac8%5E%21/#F1 The -4 typo was fixed in chromium with: https://chromium.googlesource.com/chromium/src/build/config/+/be2d385088cfb3a9f9f92c1dcb5c39b40fa28271%5E%21/#F0 And prefix isn't set in openssl pkg-config since: openssl/openssl@2ac569a Signed-off-by: Martin Jansa <[email protected]>
- Loading branch information