Skip to content

Commit

Permalink
meson: Fix git version parsing
Browse files Browse the repository at this point in the history
When extracting the build metadata from the git version, we use the
string strip() method to remove the version prefix. This is incorrect,
as the strip() method takes a set of characters to be removed, not a
literal string. Fix it by splitting the git version string on the '+'
character and keeping the suffix.

Fixes: 02518e5 ("meson: Rewrite .replace usage")
Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Kieran Bingham <[email protected]>
Reviewed-by: Michael Riesch <[email protected]>
Signed-off-by: Kieran Bingham <[email protected]>
  • Loading branch information
pinchartl authored and kbingham committed Mar 21, 2023
1 parent 2ccca09 commit d34cefa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ if libcamera_version != project_version

# Replace the version components reported by git with the release version,
# but keep all trailing information supplied by git.
libcamera_git_version = (project_version +
libcamera_git_version.strip(libcamera_version))
libcamera_git_version = (project_version + '+' +
libcamera_git_version.split('+')[1])
libcamera_version = project_version

# Append a marker to show we have modified this version string
Expand Down

0 comments on commit d34cefa

Please sign in to comment.