File tree 2 files changed +11
-4
lines changed
keychain_win/keychain_service/service_installer/wsserverinstaller
2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -40,14 +40,15 @@ about_info keychain_app::version_info::about()
40
40
41
41
std::string keychain_app::version_info::version ()
42
42
{
43
- static const std::regex VERSION_REGEXP (" ^\\ d+\\ .\\ d+\\ -\\ d+ " );
43
+ static const std::regex VERSION_REGEXP (" ^\\ d+\\ .\\ d+( \\ -\\ d)* " );
44
44
std::string description_string ( git_revision_description );
45
45
auto it = std::sregex_iterator (description_string.begin (), description_string.end (), VERSION_REGEXP);
46
46
if (it == std::sregex_iterator ())
47
47
FC_LIGHT_THROW_EXCEPTION (fc_light::internal_error_exception, " Invalid version string has been returned by Git" );
48
48
auto version_string = it->str ();
49
49
auto replace_pos = version_string.find (' -' );
50
- version_string[replace_pos] = ' .' ;
50
+ if (replace_pos != std::string::npos)
51
+ version_string[replace_pos] = ' .' ;
51
52
return version_string;
52
53
}
53
54
Original file line number Diff line number Diff line change @@ -127,9 +127,15 @@ if(WIN32)
127
127
list ( APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR} /git_version_gen" )
128
128
include ( GetGitRevisionDescription )
129
129
git_describe(KEYCHAIN_COMMON_GIT_REVISION_DESCRIPTION --tags)
130
- SET (VERSION_REGEXP "^[0-9]+\\ .[0-9]+\\ -[0-9]+ " )
130
+ SET (VERSION_REGEXP "^[0-9]+\\ .[0-9]+( \\ -[0-9])* " )
131
131
string (REGEX MATCH ${VERSION_REGEXP} VERSION_STRING_GIT ${KEYCHAIN_COMMON_GIT_REVISION_DESCRIPTION} )
132
- string (REGEX REPLACE "\\ -" "." VERSION_STRING ${VERSION_STRING_GIT} )
132
+ string (FIND ${VERSION_STRING_GIT} "-" 3RD_NUM_POS)
133
+ if (${3RD_NUM_POS} EQUAL "-1" )
134
+ set (VERSION_STRING ${VERSION_STRING_GIT} )
135
+ string (APPEND VERSION_STRING ".0" )
136
+ else ()
137
+ string (REPLACE "-" "." VERSION_STRING ${VERSION_STRING_GIT} )
138
+ endif ()
133
139
set (installerversion ${VERSION_STRING} )
134
140
135
141
#-bf - flag causes all of the files to be bound int the resulting .wixout/.* file.
You can’t perform that action at this time.
0 commit comments