]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commit
package_rpm: Fix Linux 6.1.0 perf 1.0 version mistranslation
authorMarek Vasut <marex@denx.de>
Sat, 17 Dec 2022 04:57:38 +0000 (05:57 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 17 Dec 2022 23:49:04 +0000 (23:49 +0000)
commitbf2096a43d56c2d633a4b6e3db9e4390da4be6e2
treeff34d1d634affec896d9301ad57b23978d2e8b7b
parentd9398dfb0866a5be9ed09ae15902606fe11da2d2
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.

Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-global/package_rpm.bbclass