List:Commits« Previous MessageNext Message »
From:Joerg Bruehe Date:December 21 2010 10:11am
Subject:bzr commit into mysql-5.5-bugteam branch (joerg:3209) Bug#42969
View as plain text  
#At file:///MySQL/REPO/V55/bug42969-5.5/ based on revid:jorgen.loland@stripped

 3209 Joerg Bruehe	2010-12-21
      Fix bug#42969    Please add a MANIFEST to each build
      
      This is work-in-progress, not yet ready for review:
      The current changeset is the first step only, but it must
      be committed in order to proceed ("bzr export" is needed).
      
      Step 1: Create "MANIFEST_source" during "make dist".
     @ cmake/make_dist.cmake.in
        Use the new "manifest.cmake" file during "make dist".
     @ cmake/manifest.cmake.in
        New file.
        
        It will contain macros to handle the "MANIFEST*" files
        during various steps of the build,
        the calls will be at other places.
        
        Step 1: Macro "CREATE_MANIFEST_SOURCE" only.
     @ sql/CMakeLists.txt
        Handle the (new) "cmake/manifest.cmake.in" file
        by running CONFIGURE_FILE() on it.

    added:
      cmake/manifest.cmake.in
    modified:
      cmake/make_dist.cmake.in
      sql/CMakeLists.txt
=== modified file 'cmake/make_dist.cmake.in'
--- a/cmake/make_dist.cmake.in	2010-11-20 14:47:50 +0000
+++ b/cmake/make_dist.cmake.in	2010-12-21 10:11:17 +0000
@@ -106,6 +106,10 @@ IF(MYSQL_DOCS_LOCATION)
   EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy_directory "${MYSQL_DOCS_LOCATION}" "${PACKAGE_DIR}")
 ENDIF()
 
+# Create the "MANIFEST_source" file.
+INCLUDE(${CMAKE_BINARY_DIR}/manifest.cmake)
+CREATE_MANIFEST_SOURCE()
+
 # In case we used CPack, it could have copied some
 # extra files that are not usable on different machines.
 FILE(REMOVE ${PACKAGE_DIR}/CMakeCache.txt)

=== added file 'cmake/manifest.cmake.in'
--- a/cmake/manifest.cmake.in	1970-01-01 00:00:00 +0000
+++ b/cmake/manifest.cmake.in	2010-12-21 10:11:17 +0000
@@ -0,0 +1,48 @@
+# Copyright (C) 2010, Oracle and/or its affiliates
+# 
+# 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
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA 
+
+# Handle/create the "MANIFEST" files describing a MySQL (server) binary.
+# This is part of the fix for bug#42969.
+
+SET(VERSION "@VERSION@")
+SET(CMAKE_SOURCE_DIR "@CMAKE_SOURCE_DIR@")
+SET(CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@")
+SET(CPACK_SOURCE_PACKAGE_FILE_NAME "@CPACK_SOURCE_PACKAGE_FILE_NAME@")
+SET(BZR_EXECUTABLE "@BZR_EXECUTABLE@")
+SET(PACKAGE_DIR  ${CMAKE_BINARY_DIR}/${CPACK_SOURCE_PACKAGE_FILE_NAME})
+ 
+ 
+# This is used during "make dist".
+# So this is the moment to start a "MANIFEST_source" file with information about the source (only).
+# We use the "VERSION" contents and try to add "bzr version-info".
+#
+# It will also be used during build, if that is done without a preceding "make dist"
+# (typically, by developers directly in their tree).
+  
+MACRO(CREATE_MANIFEST_SOURCE)
+  IF(BZR_EXECUTABLE)
+    # We have a working "bzr" and a BZR repository
+    EXECUTE_PROCESS(
+      COMMAND ${BZR_EXECUTABLE} version-info ${CMAKE_SOURCE_DIR}
+      WORKING_DIRECTORY ${PACKAGE_DIR}
+      OUTPUT_FILE "MANIFEST_source"
+      RESULT_VARIABLE RESULT
+    )
+    MESSAGE("Ran '${BZR_EXECUTABLE} version-info' with result ${RESULT}")
+  ENDIF()
+  # The following is a fall-back if there should be no BZR available.
+  FILE(APPEND "${PACKAGE_DIR}/MANIFEST_source" "\nMySQL source ${VERSION}\n")
+ENDMACRO(CREATE_MANIFEST_SOURCE)
+

=== modified file 'sql/CMakeLists.txt'
--- a/sql/CMakeLists.txt	2010-11-20 14:47:50 +0000
+++ b/sql/CMakeLists.txt	2010-12-21 10:11:17 +0000
@@ -229,6 +229,8 @@ ENDFOREACH()
 
 CONFIGURE_FILE(
   ${CMAKE_SOURCE_DIR}/cmake/make_dist.cmake.in ${CMAKE_BINARY_DIR}/make_dist.cmake @ONLY)
+CONFIGURE_FILE(
+  ${CMAKE_SOURCE_DIR}/cmake/manifest.cmake.in ${CMAKE_BINARY_DIR}/manifest.cmake @ONLY)
 
 ADD_CUSTOM_TARGET(dist 
   COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}/make_dist.cmake


Attachment: [text/bzr-bundle] bzr/joerg@mysql.com-20101221101117-j7of891qdaiqjgpa.bundle
Thread
bzr commit into mysql-5.5-bugteam branch (joerg:3209) Bug#42969Joerg Bruehe21 Dec