Bug#19908468 PLACE CORRECT INFORMATION IN INFO_SRC AFTER TRANSITIONING TO GIT
Use 'git log -1; git branch' rather than 'bzr version-info'
This commit is contained in:
parent
9bd6e87545
commit
2ee7167bbd
@ -427,7 +427,8 @@ CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/include/mysql_version.h.in
|
|||||||
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc.in
|
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc.in
|
||||||
${CMAKE_BINARY_DIR}/sql/sql_builtin.cc)
|
${CMAKE_BINARY_DIR}/sql/sql_builtin.cc)
|
||||||
CONFIGURE_FILE(
|
CONFIGURE_FILE(
|
||||||
${CMAKE_SOURCE_DIR}/cmake/info_macros.cmake.in ${CMAKE_BINARY_DIR}/info_macros.cmake @ONLY)
|
${CMAKE_SOURCE_DIR}/cmake/info_macros.cmake.in
|
||||||
|
${CMAKE_BINARY_DIR}/info_macros.cmake @ONLY)
|
||||||
|
|
||||||
# Handle the "INFO_*" files.
|
# Handle the "INFO_*" files.
|
||||||
INCLUDE(${CMAKE_BINARY_DIR}/info_macros.cmake)
|
INCLUDE(${CMAKE_BINARY_DIR}/info_macros.cmake)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
|
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@ -28,6 +28,7 @@ SET(CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@")
|
|||||||
SET(CMAKE_GENERATOR "@CMAKE_GENERATOR@")
|
SET(CMAKE_GENERATOR "@CMAKE_GENERATOR@")
|
||||||
SET(CMAKE_SIZEOF_VOID_P "@CMAKE_SIZEOF_VOID_P@")
|
SET(CMAKE_SIZEOF_VOID_P "@CMAKE_SIZEOF_VOID_P@")
|
||||||
SET(BZR_EXECUTABLE "@BZR_EXECUTABLE@")
|
SET(BZR_EXECUTABLE "@BZR_EXECUTABLE@")
|
||||||
|
SET(GIT_EXECUTABLE "@GIT_EXECUTABLE@")
|
||||||
SET(CMAKE_CROSSCOMPILING "@CMAKE_CROSSCOMPILING@")
|
SET(CMAKE_CROSSCOMPILING "@CMAKE_CROSSCOMPILING@")
|
||||||
SET(CMAKE_HOST_SYSTEM "@CMAKE_HOST_SYSTEM@")
|
SET(CMAKE_HOST_SYSTEM "@CMAKE_HOST_SYSTEM@")
|
||||||
SET(CMAKE_HOST_SYSTEM_PROCESSOR "@CMAKE_HOST_SYSTEM_PROCESSOR@")
|
SET(CMAKE_HOST_SYSTEM_PROCESSOR "@CMAKE_HOST_SYSTEM_PROCESSOR@")
|
||||||
@ -44,7 +45,24 @@ SET(CMAKE_SYSTEM_PROCESSOR "@CMAKE_SYSTEM_PROCESSOR@")
|
|||||||
MACRO(CREATE_INFO_SRC target_dir)
|
MACRO(CREATE_INFO_SRC target_dir)
|
||||||
SET(INFO_SRC "${target_dir}/INFO_SRC")
|
SET(INFO_SRC "${target_dir}/INFO_SRC")
|
||||||
|
|
||||||
IF(EXISTS ${CMAKE_SOURCE_DIR}/.bzr)
|
IF(GIT_EXECUTABLE AND EXISTS ${CMAKE_SOURCE_DIR}/.git)
|
||||||
|
# Sources are in a GIT repository: Always update.
|
||||||
|
EXECUTE_PROCESS(
|
||||||
|
COMMAND ${GIT_EXECUTABLE} log -1
|
||||||
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||||
|
OUTPUT_VARIABLE VERSION_INFO
|
||||||
|
RESULT_VARIABLE RESULT
|
||||||
|
)
|
||||||
|
FILE(WRITE ${INFO_SRC} "git log -1: ${VERSION_INFO}\n")
|
||||||
|
EXECUTE_PROCESS(
|
||||||
|
COMMAND ${GIT_EXECUTABLE} branch
|
||||||
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||||
|
OUTPUT_VARIABLE VERSION_INFO
|
||||||
|
RESULT_VARIABLE RESULT
|
||||||
|
)
|
||||||
|
FILE(APPEND ${INFO_SRC} "${VERSION_INFO}\n")
|
||||||
|
FILE(APPEND ${INFO_SRC} "\nMySQL source ${VERSION}\n")
|
||||||
|
ELSEIF(EXISTS ${CMAKE_SOURCE_DIR}/.bzr)
|
||||||
# Sources are in a BZR repository: Always update.
|
# Sources are in a BZR repository: Always update.
|
||||||
EXECUTE_PROCESS(
|
EXECUTE_PROCESS(
|
||||||
COMMAND ${BZR_EXECUTABLE} version-info ${CMAKE_SOURCE_DIR}
|
COMMAND ${BZR_EXECUTABLE} version-info ${CMAKE_SOURCE_DIR}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
Checking 'INFO_SRC' and 'INFO_BIN'
|
Checking 'INFO_SRC' and 'INFO_BIN'
|
||||||
INFO_SRC: Found MySQL version number / Found BZR revision id
|
INFO_SRC: Found MySQL version number / Found GIT revision id
|
||||||
INFO_BIN: Found 'Compiler ... used' line / Found 'Feature flags' line
|
INFO_BIN: Found 'Compiler ... used' line / Found 'Feature flags' line
|
||||||
|
|
||||||
End of tests
|
End of tests
|
||||||
|
@ -47,7 +47,7 @@ $found_revision = "No line 'revision-id: .....'";
|
|||||||
open(I_SRC,"<","$dir_docs/INFO_SRC") or print "Cannot open 'INFO_SRC' in '$dir_docs' (starting from bindir '$dir_bin')\n";
|
open(I_SRC,"<","$dir_docs/INFO_SRC") or print "Cannot open 'INFO_SRC' in '$dir_docs' (starting from bindir '$dir_bin')\n";
|
||||||
while(defined ($line = <I_SRC>)) {
|
while(defined ($line = <I_SRC>)) {
|
||||||
if ($line =~ m|^MySQL source \d\.\d\.\d+|) {$found_version = "Found MySQL version number";}
|
if ($line =~ m|^MySQL source \d\.\d\.\d+|) {$found_version = "Found MySQL version number";}
|
||||||
if ($line =~ m|^revision-id: .*@.*-2\d{13}-\w+$|) {$found_revision = "Found BZR revision id";}
|
if ($line =~ m|^git log -1: commit \w{40}$|) {$found_revision = "Found GIT revision id";}
|
||||||
}
|
}
|
||||||
close I_SRC;
|
close I_SRC;
|
||||||
print "INFO_SRC: $found_version / $found_revision\n";
|
print "INFO_SRC: $found_version / $found_revision\n";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user