Skip to content

Commit

Permalink
Don't fail on a .x versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
romainthomas committed Dec 12, 2024
1 parent 531377b commit 35ae8dc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions api/python/backend/versioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ def format_version(self, version: str, fmt: str, is_dev: bool = False):

if branch is not None and branch.startswith("release/"):
_, version = branch.split("release/")
major, minor, patch = version.split('.')
if patch == 'x':
return f"{major}.{minor}"
return version

parts = version.split('-')
Expand Down
8 changes: 6 additions & 2 deletions cmake/LIEFGit.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,15 @@ else()
endif()
message(STATUS "Current branch: ${LIEF_GIT_BRANCH}")


if (VERSION_STRING)
list(LENGTH VERSION_STRING VERSION_STRING_LEN)
list(GET VERSION_STRING 0 LIEF_VERSION_MAJOR)
list(GET VERSION_STRING 1 LIEF_VERSION_MINOR)
list(GET VERSION_STRING 2 LIEF_VERSION_PATCH)
if (VERSION_STRING_LEN GREATER 2)
list(GET VERSION_STRING 2 LIEF_VERSION_PATCH)
else()
set(LIEF_VERSION_PATCH 0)
endif()

if (NOT ${LIEF_IS_TAGGED})
if(LIEF_GIT_BRANCH MATCHES "^release[-/]")
Expand Down

0 comments on commit 35ae8dc

Please sign in to comment.