Commit 2ee7167b authored by Tor Didriksen's avatar Tor Didriksen

Bug#19908468 PLACE CORRECT INFORMATION IN INFO_SRC AFTER TRANSITIONING TO GIT

Use 'git log -1; git branch' rather than 'bzr version-info'
parent 9bd6e875
......@@ -427,7 +427,8 @@ CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/include/mysql_version.h.in
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc.in
${CMAKE_BINARY_DIR}/sql/sql_builtin.cc)
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.
INCLUDE(${CMAKE_BINARY_DIR}/info_macros.cmake)
......
# 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
# 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_SIZEOF_VOID_P "@CMAKE_SIZEOF_VOID_P@")
SET(BZR_EXECUTABLE "@BZR_EXECUTABLE@")
SET(GIT_EXECUTABLE "@GIT_EXECUTABLE@")
SET(CMAKE_CROSSCOMPILING "@CMAKE_CROSSCOMPILING@")
SET(CMAKE_HOST_SYSTEM "@CMAKE_HOST_SYSTEM@")
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)
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.
EXECUTE_PROCESS(
COMMAND ${BZR_EXECUTABLE} version-info ${CMAKE_SOURCE_DIR}
......
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
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";
while(defined ($line = <I_SRC>)) {
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;
print "INFO_SRC: $found_version / $found_revision\n";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment