From 19e09bb751d46a56d3b946ea8bf76e2d8a7d8971 Mon Sep 17 00:00:00 2001 From: Dylan Date: Tue, 26 Dec 2023 12:30:09 -0500 Subject: [PATCH] Fix #139, updating ELF2CFETBL to use new versioning system. --- elf2cfetbl.c | 8 +++++++- elf2cfetbl_version.h | 28 +++++++++++++++++----------- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/elf2cfetbl.c b/elf2cfetbl.c index 210983b..3e7770d 100644 --- a/elf2cfetbl.c +++ b/elf2cfetbl.c @@ -34,6 +34,7 @@ #include #include "ELF_Structures.h" #include "cfe_tbl_filedef.h" +#include "cfe_version.h" #include "elf2cfetbl_version.h" #define MAX_SECTION_HDR_NAME_LEN (128) @@ -1264,7 +1265,12 @@ int32 ProcessCmdLineOptions(int ArgumentCount, char *Arguments[]) void OutputVersionInfo(void) { - printf("\n%s\n", ELF2CFETBL_VERSION_STRING); + char VersionString[ELF2CFETBL_CFG_MAX_VERSION_STR_LEN]; + + CFE_Config_GetVersionString(VersionString, ELF2CFETBL_CFG_MAX_VERSION_STR_LEN, "elf2cfetbl", ELF2CFETBL_BUILD_TYPE, + ELF2CFETBL_VERSION, ELF2CFETBL_BUILD_CODENAME, ELF2CFETBL_LAST_OFFICIAL); + + printf("\n%s\n", VersionString); } /** diff --git a/elf2cfetbl_version.h b/elf2cfetbl_version.h index 4528223..e47b9e3 100644 --- a/elf2cfetbl_version.h +++ b/elf2cfetbl_version.h @@ -28,9 +28,11 @@ /* * Development Build Macro Definitions */ -#define ELF2CFETBL_BUILD_NUMBER 36 /*!< @brief Number of commits since baseline */ -#define ELF2CFETBL_BUILD_BASELINE \ - "v3.3.0-rc4" /*!< @brief Development Build: git tag that is the base for the current */ +#define ELF2CFETBL_BUILD_NUMBER 36 /*!< @brief Number of commits since baseline */ +#define ELF2CFETBL_BUILD_BASELINE "equuleues-rc1" /*!< @brief Development Build: git tag that is the base for the current */ +#define ELF2CFETBL_BUILD_DEV_CYCLE "equuleus-rc2" /**< @brief Development: Release name for current development cycle */ +#define ELF2CFETBL_BUILD_TYPE "Development Build" /**< @brief: Development: Type of build (Development Build or Release) */ +#define ELF2CFETBL_BUILD_CODENAME "Equuleus" /**< @brief: Development: Code name for the current build */ /* * Version Macros, see \ref cfsversions for definitions. @@ -39,6 +41,11 @@ #define ELF2CFETBL_MINOR_VERSION 1 /*!< @brief Minor version number */ #define ELF2CFETBL_REVISION 99 /*!< @brief Revision version number. Value of 99 indicates a development version.*/ +/** + * @brief Last official release. + */ +#define ELF2CFETBL_LAST_OFFICIAL "v3.1.0" + /*! * @brief Mission revision. * @@ -46,7 +53,7 @@ * Values 1-254 are reserved for mission use to denote patches/customizations as needed. NOTE: Reserving 0 and 0xFF for * cFS open-source development use (pending resolution of nasa/cFS#440) */ -#define ELF2CFETBL_MISSION_REV 0xFF +#define ELF2CFETBL_MISSION_REV 0x00 /* * Tools to construct version string @@ -61,13 +68,12 @@ */ #define ELF2CFETBL_VERSION ELF2CFETBL_BUILD_BASELINE ELF2CFETBL_STR(ELF2CFETBL_BUILD_NUMBER) -/*! @brief Development Build Version String. - * @details Reports the current development build's baseline, number, and name. Also includes a note about the latest - * official version. @n See @ref cfsversions for format differences between development and release versions. +/** + * @brief Max Version String length. + * + * Maximum length that an elf2cfetbl version string can be. + * */ -#define ELF2CFETBL_VERSION_STRING \ - " elf2cfetbl Development Build\n" \ - " " ELF2CFETBL_VERSION " (Codename: Draco)\n" /* Codename for current development */ \ - " Last Official Release: elf2cfetbl v3.1.0" /* For full support please use official release version */ +#define ELF2CFETBL_CFG_MAX_VERSION_STR_LEN 256 #endif /* ELF2CFETBL_VERSION_H */