Show version in System Information + help/log version reformat (#15195)

This commit is contained in:
sonninnos 2023-04-14 23:28:09 +03:00 committed by GitHub
parent dd106c4f4a
commit 5722d90a38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 59 additions and 27 deletions

View File

@ -602,6 +602,10 @@ MSG_HASH(
MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_BUILD_DATE,
"Build Date"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_RETROARCH_VERSION,
"RetroArch Version"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_GIT_VERSION,
"Git Version"

View File

@ -92,6 +92,7 @@
#include "../file_path_special.h"
#include "../defaults.h"
#include "../verbosity.h"
#include "../version.h"
#ifdef HAVE_CHEATS
#include "../cheat_manager.h"
#endif
@ -1666,19 +1667,22 @@ static unsigned menu_displaylist_parse_system_info(file_list_t *list)
const char *tmp_string = NULL;
const frontend_ctx_driver_t *frontend = frontend_get_ptr();
const char *menu_driver = menu_driver_ident();
size_t _len = strlcpy(tmp,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_BUILD_DATE),
(void)tmp_string;
{
size_t len = strlcpy(tmp,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_RETROARCH_VERSION),
sizeof(tmp));
tmp[_len ] = ':';
tmp[_len+1] = ' ';
tmp[_len+2] = '\0';
strlcat(tmp, __DATE__, sizeof(tmp));
tmp[len ] = ':';
tmp[len+1] = ' ';
tmp[len+2] = '\0';
strlcat(tmp, PACKAGE_VERSION, sizeof(tmp));
if (menu_entries_append(list, tmp, "",
MENU_ENUM_LABEL_SYSTEM_INFO_ENTRY, MENU_SETTINGS_CORE_INFO_NONE, 0, 0, NULL))
count++;
(void)tmp_string;
}
#ifdef HAVE_GIT_VERSION
{
@ -1689,12 +1693,27 @@ static unsigned menu_displaylist_parse_system_info(file_list_t *list)
tmp[len+1] = ' ';
tmp[len+2] = '\0';
strlcat(tmp, retroarch_git_version, sizeof(tmp));
if (menu_entries_append(list, tmp, "",
MENU_ENUM_LABEL_SYSTEM_INFO_ENTRY, MENU_SETTINGS_CORE_INFO_NONE, 0, 0, NULL))
count++;
}
#endif
{
size_t len = strlcpy(tmp,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_BUILD_DATE),
sizeof(tmp));
tmp[len ] = ':';
tmp[len+1] = ' ';
tmp[len+2] = '\0';
strlcat(tmp, __DATE__, sizeof(tmp));
if (menu_entries_append(list, tmp, "",
MENU_ENUM_LABEL_SYSTEM_INFO_ENTRY, MENU_SETTINGS_CORE_INFO_NONE, 0, 0, NULL))
count++;
}
retroarch_get_capabilities(RARCH_CAPABILITIES_COMPILER, tmp, sizeof(tmp), 0);
if (menu_entries_append(list, tmp, "",
MENU_ENUM_LABEL_SYSTEM_INFO_ENTRY, MENU_SETTINGS_CORE_INFO_NONE, 0, 0, NULL))
@ -4012,6 +4031,13 @@ static unsigned menu_displaylist_parse_information_list(file_list_t *info_list)
}
#endif
if (menu_entries_append(info_list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SYSTEM_INFORMATION),
msg_hash_to_str(MENU_ENUM_LABEL_SYSTEM_INFORMATION),
MENU_ENUM_LABEL_SYSTEM_INFORMATION,
MENU_SETTING_ACTION, 0, 0, NULL))
count++;
#if defined(HAVE_NETWORKING) && defined(HAVE_IFINFO)
if (menu_entries_append(info_list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETWORK_INFORMATION),
@ -4021,13 +4047,6 @@ static unsigned menu_displaylist_parse_information_list(file_list_t *info_list)
count++;
#endif
if (menu_entries_append(info_list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SYSTEM_INFORMATION),
msg_hash_to_str(MENU_ENUM_LABEL_SYSTEM_INFORMATION),
MENU_ENUM_LABEL_SYSTEM_INFORMATION,
MENU_SETTING_ACTION, 0, 0, NULL))
count++;
#ifdef HAVE_LIBRETRODB
if (menu_entries_append(info_list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_DATABASE_MANAGER),

View File

@ -3210,6 +3210,7 @@ enum msg_hash_enums
MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_LAKKA_VERSION,
MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_DYNAMIC_SUPPORT,
MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_BUILD_DATE,
MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_RETROARCH_VERSION,
MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_GIT_VERSION,
MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_CPU_MODEL,
MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_CPU_FEATURES,

View File

@ -4906,17 +4906,17 @@ static void retroarch_print_version(void)
frontend_driver_attach_console();
fprintf(stdout, "%s: %s -- v%s",
fprintf(stdout, "%s - %s\n",
msg_hash_to_str(MSG_PROGRAM),
msg_hash_to_str(MSG_LIBRETRO_FRONTEND),
PACKAGE_VERSION);
msg_hash_to_str(MSG_LIBRETRO_FRONTEND));
fprintf(stdout, "Version: %s", PACKAGE_VERSION);
#ifdef HAVE_GIT_VERSION
printf(" -- %s --\n", retroarch_git_version);
#else
printf("\n");
fprintf(stdout, " (Git %s)", retroarch_git_version);
#endif
fprintf(stdout, " " __DATE__ "\n");
retroarch_get_capabilities(RARCH_CAPABILITIES_COMPILER, str, sizeof(str), 0);
strlcat(str, " Built: " __DATE__, sizeof(str));
fprintf(stdout, "%s\n", str);
}
@ -6144,6 +6144,7 @@ bool retroarch_main_init(int argc, char *argv[])
RARCH_LOG_OUTPUT("%s", str_output);
}
{
char str_output[256];
char str[128];
@ -6151,14 +6152,21 @@ bool retroarch_main_init(int argc, char *argv[])
#ifdef HAVE_GIT_VERSION
snprintf(str_output, sizeof(str_output),
"%s: %s" "\n" FILE_PATH_LOG_INFO " Built: " __DATE__ "\n" FILE_PATH_LOG_INFO " Version: " PACKAGE_VERSION "\n" FILE_PATH_LOG_INFO " Git: %s" "\n" FILE_PATH_LOG_INFO " =================================================\n",
"%s: %s" "\n"
FILE_PATH_LOG_INFO " Version: " PACKAGE_VERSION "\n"
FILE_PATH_LOG_INFO " Git: %s" "\n"
FILE_PATH_LOG_INFO " Built: " __DATE__ "\n"
FILE_PATH_LOG_INFO " =================================================\n",
msg_hash_to_str(MSG_CAPABILITIES),
str,
retroarch_git_version
);
#else
snprintf(str_output, sizeof(str_output),
"%s: %s" "\n" FILE_PATH_LOG_INFO " Built: " __DATE__ "\n" FILE_PATH_LOG_INFO " Version: " PACKAGE_VERSION "\n" FILE_PATH_LOG_INFO " =================================================\n",
"%s: %s" "\n"
FILE_PATH_LOG_INFO " Version: " PACKAGE_VERSION "\n"
FILE_PATH_LOG_INFO " Built: " __DATE__ "\n"
FILE_PATH_LOG_INFO " =================================================\n",
msg_hash_to_str(MSG_CAPABILITIES),
str);
#endif