mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 02:25:17 +00:00
Make ReactOS report the Git revision as output by "git describe".
- REVISION is now something like "0.4.7-dev-53-g1304b53" instead of "r12345". - Change WINDOWS_NT_BANNER to better represent the ReactOS version and the reported NT version. - Introduce REACTOS_COMMIT_HASH which contains the full 40-character commit hash (for comparing revisions, e.g. in rosautotest/testman).
This commit is contained in:
parent
c2c66aff7d
commit
3d6040615a
6 changed files with 43 additions and 58 deletions
|
@ -119,7 +119,7 @@ CConfiguration::GetSystemInformation()
|
||||||
|
|
||||||
/* Get the build from the define */
|
/* Get the build from the define */
|
||||||
ss << "&revision=";
|
ss << "&revision=";
|
||||||
ss << KERNEL_VERSION_BUILD_HEX;
|
ss << KERNEL_VERSION_COMMIT_HASH;
|
||||||
|
|
||||||
ss << "&platform=";
|
ss << "&platform=";
|
||||||
|
|
||||||
|
|
|
@ -1428,15 +1428,12 @@ Phase1InitializationDiscard(IN PVOID Context)
|
||||||
if (CmCSDVersionString.Length)
|
if (CmCSDVersionString.Length)
|
||||||
{
|
{
|
||||||
/* Print the version string */
|
/* Print the version string */
|
||||||
/* ReactOS specific: Append also the revision number */
|
|
||||||
Status = RtlStringCbPrintfExA(StringBuffer,
|
Status = RtlStringCbPrintfExA(StringBuffer,
|
||||||
Remaining,
|
Remaining,
|
||||||
&EndBuffer,
|
&EndBuffer,
|
||||||
&Remaining,
|
&Remaining,
|
||||||
0,
|
0,
|
||||||
" r%u"
|
|
||||||
": %wZ",
|
": %wZ",
|
||||||
KERNEL_VERSION_BUILD_HEX,
|
|
||||||
&CmCSDVersionString);
|
&CmCSDVersionString);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
@ -1471,9 +1468,12 @@ Phase1InitializationDiscard(IN PVOID Context)
|
||||||
if (NT_SUCCESS(MsgStatus))
|
if (NT_SUCCESS(MsgStatus))
|
||||||
{
|
{
|
||||||
/* Create the banner message */
|
/* Create the banner message */
|
||||||
|
/* ReactOS specific: Report ReactOS version, NtBuildLab information and reported NT kernel version */
|
||||||
Status = RtlStringCbPrintfA(EndBuffer,
|
Status = RtlStringCbPrintfA(EndBuffer,
|
||||||
Remaining,
|
Remaining,
|
||||||
(PCHAR)MsgEntry->Text,
|
(PCHAR)MsgEntry->Text,
|
||||||
|
KERNEL_VERSION_STR,
|
||||||
|
NtBuildLab,
|
||||||
StringBuffer,
|
StringBuffer,
|
||||||
NtBuildNumber & 0xFFFF,
|
NtBuildNumber & 0xFFFF,
|
||||||
BeginBuffer);
|
BeginBuffer);
|
||||||
|
|
|
@ -3,13 +3,14 @@
|
||||||
#define _INC_REACTOS_BUILDNO
|
#define _INC_REACTOS_BUILDNO
|
||||||
|
|
||||||
#define KERNEL_VERSION_BUILD @KERNEL_VERSION_BUILD@
|
#define KERNEL_VERSION_BUILD @KERNEL_VERSION_BUILD@
|
||||||
#define KERNEL_VERSION_BUILD_HEX 0x@KERNEL_VERSION_BUILD_HEX@
|
|
||||||
#define KERNEL_VERSION_BUILD_STR "@KERNEL_VERSION_BUILD@-@REVISION@"
|
#define KERNEL_VERSION_BUILD_STR "@KERNEL_VERSION_BUILD@-@REVISION@"
|
||||||
#define KERNEL_VERSION_BUILD_RC "@KERNEL_VERSION_BUILD@-@REVISION@\0"
|
#define KERNEL_VERSION_BUILD_RC "@KERNEL_VERSION_BUILD@-@REVISION@\0"
|
||||||
|
|
||||||
#define KERNEL_VERSION_RC "@KERNEL_VERSION@\0"
|
#define KERNEL_VERSION_RC "@KERNEL_VERSION@\0"
|
||||||
#define KERNEL_VERSION_STR "@KERNEL_VERSION@"
|
#define KERNEL_VERSION_STR "@KERNEL_VERSION@"
|
||||||
|
|
||||||
|
#define KERNEL_VERSION_COMMIT_HASH "@COMMIT_HASH@"
|
||||||
|
|
||||||
#define REACTOS_DLL_VERSION_MAJOR @REACTOS_DLL_VERSION_MAJOR@
|
#define REACTOS_DLL_VERSION_MAJOR @REACTOS_DLL_VERSION_MAJOR@
|
||||||
#define REACTOS_DLL_VERSION_RC "@DLL_VERSION_STR@\0"
|
#define REACTOS_DLL_VERSION_RC "@DLL_VERSION_STR@\0"
|
||||||
#define REACTOS_DLL_VERSION_STR "@DLL_VERSION_STR@"
|
#define REACTOS_DLL_VERSION_STR "@DLL_VERSION_STR@"
|
||||||
|
|
|
@ -19,7 +19,9 @@ Severity=Informational
|
||||||
Facility=System
|
Facility=System
|
||||||
SymbolicName=WINDOWS_NT_BANNER
|
SymbolicName=WINDOWS_NT_BANNER
|
||||||
Language=English
|
Language=English
|
||||||
ReactOS (R) Kernel Version %hs (Build %u%hs)
|
ReactOS Version %s
|
||||||
|
Build %s
|
||||||
|
Reporting NT %s (Build %u%s)
|
||||||
.
|
.
|
||||||
|
|
||||||
MessageId=0x87
|
MessageId=0x87
|
||||||
|
|
|
@ -1,63 +1,50 @@
|
||||||
macro(inttohex INTVALUE OUTPUT_VARIABLE)
|
|
||||||
list(APPEND HEXLIST 0 1 2 3 4 5 6 7 8 9 a b c d e f)
|
|
||||||
list(GET HEXLIST ${INTVALUE} ${OUTPUT_VARIABLE})
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
macro(converttohex INTVALUE OUTPUT_VARIABLE)
|
|
||||||
set(${OUTPUT_VARIABLE} "")
|
|
||||||
set(REMAINING ${INTVALUE})
|
|
||||||
while(REMAINING)
|
|
||||||
math(EXPR REMAINDER "${REMAINING}%16")
|
|
||||||
inttohex(${REMAINDER} HEXCHAR)
|
|
||||||
math(EXPR REMAINING "${REMAINING}/16")
|
|
||||||
set(${OUTPUT_VARIABLE} "${HEXCHAR}${${OUTPUT_VARIABLE}}")
|
|
||||||
endwhile()
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
string(TIMESTAMP KERNEL_VERSION_BUILD %Y%m%d UTC)
|
string(TIMESTAMP KERNEL_VERSION_BUILD %Y%m%d UTC)
|
||||||
|
|
||||||
set(KERNEL_VERSION_MAJOR "0")
|
set(KERNEL_VERSION_MAJOR "0")
|
||||||
set(KERNEL_VERSION_MINOR "5")
|
set(KERNEL_VERSION_MINOR "4")
|
||||||
set(KERNEL_VERSION_PATCH_LEVEL "0")
|
set(KERNEL_VERSION_PATCH_LEVEL "7")
|
||||||
set(COPYRIGHT_YEAR "2017")
|
set(COPYRIGHT_YEAR "2017")
|
||||||
|
|
||||||
# KERNEL_VERSION_BUILD_TYPE is "SVN" or "" (for the release)
|
# KERNEL_VERSION_BUILD_TYPE is "dev" for Git builds
|
||||||
set(KERNEL_VERSION_BUILD_TYPE "SVN")
|
# or "RC1", "RC2", "" for releases.
|
||||||
|
set(KERNEL_VERSION_BUILD_TYPE "dev")
|
||||||
|
|
||||||
# KERNEL_VERSION_RELEASE_TYPE is "RC1", "RC2" or "" (for the final one)
|
set(KERNEL_VERSION "${KERNEL_VERSION_MAJOR}.${KERNEL_VERSION_MINOR}.${KERNEL_VERSION_PATCH_LEVEL}")
|
||||||
set(KERNEL_VERSION_RELEASE_TYPE "")
|
if(NOT KERNEL_VERSION_BUILD_TYPE STREQUAL "")
|
||||||
|
|
||||||
set(KERNEL_VERSION "${KERNEL_VERSION_MAJOR}.${KERNEL_VERSION_MINOR}")
|
|
||||||
if(KERNEL_VERSION_PATCH_LEVEL)
|
|
||||||
set(KERNEL_VERSION "${KERNEL_VERSION}.${KERNEL_VERSION_PATCH_LEVEL}")
|
|
||||||
endif()
|
|
||||||
if(KERNEL_VERSION_BUILD_TYPE STREQUAL "SVN")
|
|
||||||
set(KERNEL_VERSION "${KERNEL_VERSION}-${KERNEL_VERSION_BUILD_TYPE}")
|
set(KERNEL_VERSION "${KERNEL_VERSION}-${KERNEL_VERSION_BUILD_TYPE}")
|
||||||
elseif(NOT KERNEL_VERSION_RELEASE_TYPE STREQUAL "")
|
|
||||||
set(KERNEL_VERSION "${KERNEL_VERSION}-${KERNEL_VERSION_RELEASE_TYPE}")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
math(EXPR REACTOS_DLL_VERSION_MAJOR "${KERNEL_VERSION_MAJOR}+42")
|
math(EXPR REACTOS_DLL_VERSION_MAJOR "${KERNEL_VERSION_MAJOR}+42")
|
||||||
set(DLL_VERSION_STR "${REACTOS_DLL_VERSION_MAJOR}.${KERNEL_VERSION_MINOR}")
|
set(DLL_VERSION_STR "${REACTOS_DLL_VERSION_MAJOR}.${KERNEL_VERSION_MINOR}.${KERNEL_VERSION_PATCH_LEVEL}")
|
||||||
if(KERNEL_VERSION_PATCH_LEVEL)
|
if(NOT KERNEL_VERSION_BUILD_TYPE STREQUAL "")
|
||||||
set(DLL_VERSION_STR "${DLL_VERSION_STR}.${KERNEL_VERSION_PATCH_LEVEL}")
|
|
||||||
endif()
|
|
||||||
if(KERNEL_VERSION_BUILD_TYPE STREQUAL "SVN")
|
|
||||||
set(DLL_VERSION_STR "${DLL_VERSION_STR}-${KERNEL_VERSION_BUILD_TYPE}")
|
set(DLL_VERSION_STR "${DLL_VERSION_STR}-${KERNEL_VERSION_BUILD_TYPE}")
|
||||||
elseif(NOT KERNEL_VERSION_RELEASE_TYPE STREQUAL "")
|
|
||||||
set(DLL_VERSION_STR "${DLL_VERSION_STR}-${KERNEL_VERSION_RELEASE_TYPE}")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# get svn revision number
|
# Get Git revision through "git describe"
|
||||||
set(REVISION "rUNKNOWN")
|
set(COMMIT_HASH "unknown-hash")
|
||||||
set(KERNEL_VERSION_BUILD_HEX "0")
|
set(REVISION "unknown-revision")
|
||||||
if(EXISTS "${REACTOS_SOURCE_DIR}/.svn" OR EXISTS "${REACTOS_SOURCE_DIR}/../.svn")
|
|
||||||
find_package(Subversion)
|
if(EXISTS "${REACTOS_SOURCE_DIR}/.git")
|
||||||
if(Subversion_FOUND)
|
find_package(Git)
|
||||||
subversion_wc_info(${REACTOS_SOURCE_DIR} SVNINFO)
|
if(GIT_FOUND)
|
||||||
if(SVNINFO_WC_REVISION)
|
execute_process(
|
||||||
set(REVISION "r${SVNINFO_WC_REVISION}")
|
COMMAND "${GIT_EXECUTABLE}" rev-parse HEAD
|
||||||
converttohex(${SVNINFO_WC_REVISION} KERNEL_VERSION_BUILD_HEX)
|
OUTPUT_VARIABLE GIT_COMMIT_HASH
|
||||||
|
RESULT_VARIABLE GIT_CALL_RESULT
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
|
)
|
||||||
|
if(GIT_CALL_RESULT EQUAL 0)
|
||||||
|
set(COMMIT_HASH "${GIT_COMMIT_HASH}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
execute_process(
|
||||||
|
COMMAND "${GIT_EXECUTABLE}" describe
|
||||||
|
OUTPUT_VARIABLE GIT_DESCRIBE_REVISION
|
||||||
|
RESULT_VARIABLE GIT_CALL_RESULT
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
|
)
|
||||||
|
if(GIT_CALL_RESULT EQUAL 0)
|
||||||
|
set(REVISION "${GIT_DESCRIBE_REVISION}")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -22,11 +22,6 @@
|
||||||
|
|
||||||
#define COPYRIGHT_YEAR "@COPYRIGHT_YEAR@"
|
#define COPYRIGHT_YEAR "@COPYRIGHT_YEAR@"
|
||||||
|
|
||||||
/* KERNEL_VERSION_BUILD_TYPE is "SVN" or "" (for the release) */
|
|
||||||
#define KERNEL_VERSION_BUILD_TYPE "@KERNEL_VERSION_BUILD_TYPE@"
|
|
||||||
/* KERNEL_VERSION_RELEASE_TYPE is "RC1", "RC2" or "" (for the final one) */
|
|
||||||
#define KERNEL_VERSION_RELEASE_TYPE "@KERNEL_VERSION_RELEASE_TYPE@"
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
Loading…
Reference in a new issue