dm: change the version format

The version info is mainly used to tell the user when and where the binary is
compiled and built, this will change the dm version format.
The dm follows the format:
major.minor-stable/unstable-remote_branch-acrn-commit_date-commit_id-dirty
(tag-current_commit_id) build by author date.
Compare to the hv version, which is:
major.minor-stable/unstable-remote_branch-acrn-commit_date-commit_id-dirty
DBG/REL(tag-current_commit_id) scenario@board build by author date.
The dm doesn't contain DBG/REL because it's given in configurator-tool
only for hv. also not contain scenario and board info.
e.g.
with tag:
$acrn-dm -v
DM: 3.1-stable-release_3.1-2022-09-27-11:15:42-7fad37e02-dirty(tag: v3.1)
build by zhangwei@2022-11-16 07:02:35
without tag:
$acrn-dm -v
DM: 3.2-unstable-master-2022-11-16-14:34:49-11f53d849-dirty
build by zhangwei@2022-11-16 06:49:43

Tracked-On: #8303
Signed-off-by: Zhangwei6 <wei6.zhang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
Zhangwei6
2022-11-21 11:09:09 +08:00
committed by acrnsi-robot
parent a58d2ebddc
commit b17b5992c8
2 changed files with 14 additions and 13 deletions

View File

@@ -202,9 +202,11 @@ static void outdate(char *msg)
static void
print_version(void)
{
fprintf(stdout, "DM version is: %s-%s (daily tag:%s), build by %s@%s\n",
DM_FULL_VERSION,
DM_BUILD_VERSION, DM_DAILY_TAG, DM_BUILD_USER, DM_BUILD_TIME);
fprintf(stdout, "DM: %s-%s-%s%s%s%s build by %s@%s\n",
DM_BRANCH_VERSION, DM_COMMIT_TIME, DM_COMMIT_DIRTY,
(sizeof(DM_COMMIT_TAGS) > 1) ? "(tag: " : "", DM_COMMIT_TAGS,
(sizeof(DM_COMMIT_TAGS) > 1) ? ")" : "",
DM_BUILD_USER, DM_BUILD_TIME);
exit(0);
}