ENH: version: refine file version process logic

only compare minor version when major equals
jira: no-jira

Change-Id: I0159c1b15db30238ad05b8ff7c83f6668fd11ac2
(cherry picked from commit e50e6985925582b4b686793244cc88bde3515d07)
This commit is contained in:
lane.wei
2024-12-05 21:33:26 +08:00
committed by Noisyfox
parent 312371f84c
commit bc9c08a614
2 changed files with 2 additions and 2 deletions

View File

@@ -1406,7 +1406,7 @@ int CLI::run(int argc, char **argv)
}*/
Semver cli_ver = *Semver::parse(SoftFever_VERSION);
if (!allow_newer_file && ((cli_ver.maj() != file_version.maj()) || (cli_ver.min() < file_version.min()))){
if (!allow_newer_file && ((cli_ver.maj() < file_version.maj()) || ((cli_ver.maj() == file_version.maj()) && (cli_ver.min() < file_version.min())))){
BOOST_LOG_TRIVIAL(error) << boost::format("Version Check: File Version %1% not supported by current cli version %2%")%file_version.to_string() %SoftFever_VERSION;
record_exit_reson(outfile_dir, CLI_FILE_VERSION_NOT_SUPPORTED, 0, cli_errors[CLI_FILE_VERSION_NOT_SUPPORTED], sliced_info);
flush_and_exit(CLI_FILE_VERSION_NOT_SUPPORTED);