Skip to content

Commit 7dec8c1

Browse files
Didn't, but this should
1 parent 5a73cc1 commit 7dec8c1

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ endif()
116116
configure_file(icinga-version.h.in icinga-version.h)
117117

118118
# NuGet on Windows requires a semantic versioning, example: 2.10.4.123 (only 4 element, only numeric)
119-
string(REGEX REPLACE "-([0-9]+).*$" ".\\1" ICINGA2_VERSION_SAFE "${ICINGA2_VERSION}")
119+
string(REGEX REPLACE "^[rv]" "" ICINGA2_VERSION_SAFE "${ICINGA2_VERSION}")
120+
string(REGEX REPLACE "-([0-9]+).*$" ".\\1" ICINGA2_VERSION_SAFE "${ICINGA2_VERSION_SAFE}")
120121
string(REGEX REPLACE "-[^\\.]*(.*)$" "\\1" ICINGA2_VERSION_SAFE "${ICINGA2_VERSION_SAFE}")
121122
string(REGEX REPLACE "^([0-9]+\\.[0-9]+\\.[0-9]+)[\\.]?[0-9]*" "\\1" CHOCO_VERSION_SHORT "${ICINGA2_VERSION_SAFE}")
122123

doc/21-development.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2391,12 +2391,11 @@ for implementation details.
23912391

23922392
#### Version detection
23932393

2394-
CMake determines the Icinga 2 version number using `git describe` if the
2395-
source directory is contained in a Git repository. Otherwise the version number
2396-
is extracted from the `ICINGA2_VERSION` file. This behavior can be
2397-
overridden by creating a file called `icinga-version.h.force` in the source
2398-
directory. Alternatively the `-DICINGA2_GIT_VERSION_INFO=OFF` option for CMake
2399-
can be used to disable the usage of `git describe`.
2394+
CMake determines the Icinga 2 version number using `git describe` if the source directory is contained
2395+
in a Git repository or if the source directory has been extracted from an archive built with `git-archive`.
2396+
Otherwise the version number is specified in the `ICINGA2_VERSION` variable in the main `CMakeLists.txt`
2397+
file. The `-DICINGA2_GIT_VERSION_INFO=OFF` option for CMake can be used to disable the usage of
2398+
`git describe`.
24002399

24012400

24022401
### Building RPMs <a id="development-package-builds-rpms"></a>

0 commit comments

Comments
 (0)