diff options
author | Marek Vasut <marex@denx.de> | 2022-12-17 05:57:38 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-12-17 23:49:56 +0000 |
commit | 728b86575fe6f618c12158a45218955ea61514d6 (patch) | |
tree | 73414566534a04c0a7d32b087e56c888b10411b9 /meta | |
parent | 07127e3b6e8eb87dc85f974e5749f9cbb7a7c0c4 (diff) | |
download | poky-728b86575fe6f618c12158a45218955ea61514d6.tar.gz |
package_rpm: Fix Linux 6.1.0 perf 1.0 version mistranslation
With Linux 6.1.0 and perf 1.0-r9, a build which includes perf-dev fails due
to perf-dev depending on perf 6.6.1.0-r9 . This is because translate_vers()
operates on perf-dev and mangles its version. The following scenario occurs:
ver=6.1.0-r9
pv=1.0
pkgv=6.1.0
reppv=6.1.0
With Linux 6.1.0, a corner case is hit where pv is a substring of ver, which
yields this corrupted version 6.6.1.0-r9 . Example in python3:
>>> "6.1.0-r9".replace("1.0", "6.1.0")
'6.6.1.0-r9'
>>> "6.0.13-r9".replace("1.0", "6.0.13")
'6.0.13-r9'
The fix is to only replace pv with reppv in case pv is at the beginning
of ver , instead of replacing all occurences.
(From OE-Core rev: bf2096a43d56c2d633a4b6e3db9e4390da4be6e2)
Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes-global/package_rpm.bbclass | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/meta/classes-global/package_rpm.bbclass b/meta/classes-global/package_rpm.bbclass index 81a2060b68..39efcc328e 100644 --- a/meta/classes-global/package_rpm.bbclass +++ b/meta/classes-global/package_rpm.bbclass | |||
@@ -159,7 +159,9 @@ python write_specfile () { | |||
159 | pv = subd['PV'] | 159 | pv = subd['PV'] |
160 | pkgv = subd['PKGV'] | 160 | pkgv = subd['PKGV'] |
161 | reppv = pkgv.replace('-', '+') | 161 | reppv = pkgv.replace('-', '+') |
162 | ver = ver.replace(pv, reppv).replace(pkgv, reppv) | 162 | if ver.startswith(pv): |
163 | ver = ver.replace(pv, reppv) | ||
164 | ver = ver.replace(pkgv, reppv) | ||
163 | if 'PKGR' in subd: | 165 | if 'PKGR' in subd: |
164 | # Make sure PKGR rather than PR in ver | 166 | # Make sure PKGR rather than PR in ver |
165 | pr = '-' + subd['PR'] | 167 | pr = '-' + subd['PR'] |