List:Commits« Previous MessageNext Message »
From:Bernd Ocklin Date:December 13 2012 12:35pm
Subject:bzr push into mysql-5.5-cluster-7.2 branch (bernd.ocklin:4141 to 4146)
View as plain text  
 4146 Bernd Ocklin	2012-12-13
      add mcc create zip tools

    added:
      storage/ndb/mcc/host_info/config.h.in
 4145 Bernd Ocklin	2012-12-13
      enable mcc builds

    modified:
      storage/ndb/CMakeLists.txt
 4144 Bernd Ocklin	2012-12-13
      mcc add ndb_setup to mysql.spec

    modified:
      support-files/mysql.spec.sh
 4143 Bernd Ocklin	2012-12-13
      add post install dojo unzip

    modified:
      packaging/WiX/ca/CustomAction.cpp
      packaging/WiX/ca/CustomAction.def
      packaging/WiX/mysql_server.wxs.in
 4142 Bernd Ocklin	2012-12-13
      add create_zip macro to mcc

    added:
      storage/ndb/config/type_mcc_utils.cmake
 4141 Dyre Tjeldvoll	2012-12-07
      Copy and rename mtr unit test driver from old tree

    added:
      mysql-test/suite/ndb/t/setup_pyunit.test
    modified:
      mysql-test/collections/mysql-5.5-cluster-7.2-setup.push
=== modified file 'packaging/WiX/ca/CustomAction.cpp'
--- a/packaging/WiX/ca/CustomAction.cpp	2011-06-30 15:46:53 +0000
+++ b/packaging/WiX/ca/CustomAction.cpp	2012-12-13 11:50:06 +0000
@@ -24,6 +24,7 @@
 #include <wcautil.h>
 #include <string.h>
 #include <strsafe.h>
+#include <direct.h>
 
 /*
  * Search the registry for a service whose ImagePath starts
@@ -127,7 +128,81 @@ int remove_service(TCHAR *installdir, in
 	return done;
 }
 
+UINT RunProcess(TCHAR *AppName, TCHAR *CmdLine, TCHAR * WorkDir)
+{
+    PROCESS_INFORMATION processInformation;
+    STARTUPINFO startupInfo;
+    memset(&processInformation, 0, sizeof(processInformation));
+    memset(&startupInfo, 0, sizeof(startupInfo));
+    startupInfo.cb = sizeof(startupInfo);
+
+    BOOL result;
+	UINT er = ERROR_SUCCESS;
+	
+    TCHAR tempCmdLine[MAX_PATH * 2];  //Needed since CreateProcessW may change the contents of CmdLine
+	
+	wcscpy_s(tempCmdLine, MAX_PATH *2, TEXT("\""));
+	wcscat_s(tempCmdLine, MAX_PATH *2, AppName);
+	wcscat_s(tempCmdLine, MAX_PATH *2, TEXT("\" \""));
+	wcscat_s(tempCmdLine, MAX_PATH *2, CmdLine);
+	wcscat_s(tempCmdLine, MAX_PATH *2, TEXT("\""));
+
+	result = ::CreateProcess(AppName, tempCmdLine, NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, NULL, WorkDir, &startupInfo, &processInformation);
+
+    if (result == 0)
+    {
+		WcaLog(LOGMSG_STANDARD, "CreateProcess = %ls %ls failed", AppName, CmdLine);
+		er= ERROR_CANT_ACCESS_FILE;
+    }
+    else
+    {
+		WcaLog(LOGMSG_STANDARD, "CreateProcess = %ls %ls waiting to finish", AppName, CmdLine);
+        WaitForSingleObject( processInformation.hProcess, INFINITE );
+        CloseHandle( processInformation.hProcess );
+        CloseHandle( processInformation.hThread );
+		WcaLog(LOGMSG_STANDARD, "CreateProcess = %ls %ls finished", AppName, CmdLine);
+    }
+	
+	return er;
+}
+
+UINT mccPostInstall(MSIHANDLE hInstall) {
+	HRESULT hr = S_OK;
+	UINT er = ERROR_SUCCESS;
+
+	hr = WcaInitialize(hInstall, "MccPostInstall");
+	ExitOnFailure(hr, "Failed to initialize");
+
+	WcaLog(LOGMSG_STANDARD, "Initialized.");
+
+    TCHAR INSTALLDIR[1024];
+    DWORD INSTALLDIR_size = sizeof(INSTALLDIR);
+	TCHAR path[MAX_PATH * 2];
+	TCHAR param[MAX_PATH * 2];
+	
+	if(MsiGetPropertyW(hInstall, TEXT("CustomActionData"), INSTALLDIR, &INSTALLDIR_size) == ERROR_SUCCESS) {
+	
+		WcaLog(LOGMSG_STANDARD, "INSTALLDIR = %ls", INSTALLDIR);
+		
+		// C:\Program Files (x86)\MySQL\MySQL Cluster 7.2\share\mcc
+		wcscpy_s(path, MAX_PATH * 2, INSTALLDIR);
+		wcscat_s(path, MAX_PATH * 2, TEXT("\\share\\mcc\\Python\\python.exe"));
+
+		wcscpy_s(param, MAX_PATH * 2, INSTALLDIR);
+		wcscat_s(param, MAX_PATH * 2, TEXT("\\share\\mcc\\post-install.py"));
+
+		er = RunProcess(path, param, NULL);
+		
+	} else {
+		er = ERROR_CANT_ACCESS_FILE;
+	}
+
+LExit:
+	return WcaFinalize(er);
+}
+
 UINT wrap(MSIHANDLE hInstall, char *name, int check_only) {
+
 	HRESULT hr = S_OK;
 	UINT er = ERROR_SUCCESS;
 
@@ -166,6 +241,11 @@ UINT __stdcall TestService(MSIHANDLE hIn
 	return wrap(hInstall, "TestService", 1);
 }
 
+UINT __stdcall RunPostInstall(MSIHANDLE hInstall)
+{
+	return mccPostInstall(hInstall);
+}
+
 /* DllMain - Initialize and cleanup WiX custom action utils */
 extern "C" BOOL WINAPI DllMain(
 	__in HINSTANCE hInst,

=== modified file 'packaging/WiX/ca/CustomAction.def'
--- a/packaging/WiX/ca/CustomAction.def	2010-04-30 11:30:32 +0000
+++ b/packaging/WiX/ca/CustomAction.def	2012-12-13 11:50:06 +0000
@@ -6,3 +6,4 @@ EXPORTS
 RemoveService
 RemoveServiceNoninteractive
 TestService
+RunPostInstall

=== modified file 'packaging/WiX/mysql_server.wxs.in'
--- a/packaging/WiX/mysql_server.wxs.in	2012-03-16 08:07:11 +0000
+++ b/packaging/WiX/mysql_server.wxs.in	2012-12-13 11:50:06 +0000
@@ -132,6 +132,7 @@
     <!-- How to remove the service on uninstall -->
     <Binary Id='wixca.dll' SourceFile='@WIXCA_LOCATION@' />
     <CustomAction Id="UnregisterProperty" Property="UnregisterService" Value="[INSTALLDIR]" Return="check" />
+    <CustomAction Id="RunPostInstallProperty" Property="RunPostInstall" Value="[INSTALLDIR]" Return="check" />
     <CustomAction Id="UnregisterPropertySilent" Property="UnregisterServiceSilently" Value="[INSTALLDIR]" Return="check" />
     <CustomAction Id="UnregisterService"
                   BinaryKey="wixca.dll"
@@ -145,11 +146,19 @@
                   Execute="deferred"
                   Impersonate="no"
                   Return="check" />
+    <CustomAction Id="RunPostInstall" 
+                  BinaryKey="wixca.dll"
+                  DllEntry="RunPostInstall" 
+                  Execute="deferred" 
+                  Impersonate="no" 
+                  Return="asyncWait" />
     <InstallExecuteSequence>
       <Custom Action="UnregisterProperty" After="InstallInitialize">Installed And Not UPGRADINGPRODUCTCODE And REMOVE="ALL"</Custom>
       <Custom Action="UnregisterPropertySilent" After="InstallInitialize">Installed And Not UPGRADINGPRODUCTCODE And REMOVE="ALL"</Custom>
       <Custom Action="UnregisterService" After="UnregisterProperty">Installed And Not UPGRADINGPRODUCTCODE And REMOVE="ALL" And UILevel&gt;4</Custom>
       <Custom Action="UnregisterServiceSilently" After="UnregisterPropertySilent">Installed And Not UPGRADINGPRODUCTCODE And REMOVE="ALL" And UILevel&lt;=4</Custom>
+      <Custom Action="RunPostInstallProperty" After="InstallFiles">NOT(REMOVE="ALL")</Custom>
+      <Custom Action="RunPostInstall" After="RunPostInstallProperty">NOT(REMOVE="ALL")</Custom>
     </InstallExecuteSequence>
 
     <!-- Installation root-->

=== modified file 'storage/ndb/CMakeLists.txt'
--- a/storage/ndb/CMakeLists.txt	2012-12-06 12:33:23 +0000
+++ b/storage/ndb/CMakeLists.txt	2012-12-13 12:31:29 +0000
@@ -288,6 +288,8 @@ IF (HAVE_JAVA AND HAVE_JDK)
 ENDIF()
 ADD_SUBDIRECTORY(memcache)
 
+ADD_SUBDIRECTORY(mcc)
+
 IF(WITHOUT_PARTITION_STORAGE_ENGINE)
   MESSAGE(FATAL_ERROR "NDBCLUSTER can't be compiled without PARTITION")
 ENDIF(WITHOUT_PARTITION_STORAGE_ENGINE)

=== added file 'storage/ndb/config/type_mcc_utils.cmake'
--- a/storage/ndb/config/type_mcc_utils.cmake	1970-01-01 00:00:00 +0000
+++ b/storage/ndb/config/type_mcc_utils.cmake	2012-12-13 11:41:56 +0000
@@ -0,0 +1,72 @@
+
+MACRO(PY_INSTALL)
+
+  MYSQL_PARSE_ARGUMENTS(ARG
+    "FILES;SRC_DIR;DESTINATION"
+    ""
+    ${ARGN}
+  )
+
+  SET(PY_FILES ${ARG_FILES})
+  SET(PY_SRC_DIR "${ARG_SRC_DIR}")
+  SET(PY_DEST_DIR "${ARG_DESTINATION}")
+
+  FOREACH(sfile ${PY_FILES})
+	INSTALL(FILES "${PY_SRC_DIR}/${sfile}"
+		DESTINATION "${PY_DEST_DIR}"
+		COMPONENT ClusterTools)
+#	MESSAGE(STATUS "INSTALL: ${PY_SRC_DIR}/${sfile} -> ${PY_DEST_DIR}")
+  ENDFOREACH()
+  
+ENDMACRO()
+
+MACRO(CREATE_ZIP ARCHIVE FILELIST)
+
+SET(ZIP_EXECUTABLE "")
+FIND_PROGRAM(ZIP_EXECUTABLE wzzip PATHS "$ENV{ProgramFiles}/WinZip")
+IF(ZIP_EXECUTABLE)
+    MESSAGE(STATUS "Using ${ZIP_EXECUTABLE}")
+	ADD_CUSTOM_COMMAND(OUTPUT "${ARCHIVE}" 
+	  COMMAND ${ZIP_EXECUTABLE} -P \"${ARCHIVE}\" ${FILELIST}
+      WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
+ENDIF(ZIP_EXECUTABLE)
+
+IF(NOT ZIP_EXECUTABLE)
+  FIND_PROGRAM(ZIP_EXECUTABLE 7z PATHS "$ENV{ProgramFiles}/7-Zip")
+  IF(ZIP_EXECUTABLE)
+    MESSAGE(STATUS "Using ${ZIP_EXECUTABLE}")
+	ADD_CUSTOM_COMMAND(OUTPUT "${ARCHIVE}" 
+	  COMMAND ${ZIP_EXECUTABLE} a -tzip \"${ARCHIVE}\" ${FILELIST}
+      WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
+  ENDIF(ZIP_EXECUTABLE)
+ENDIF(NOT ZIP_EXECUTABLE)
+
+IF(NOT ZIP_EXECUTABLE)
+  FIND_PACKAGE(Cygwin)
+  IF(CYGWIN_INSTALL_PATH)
+  MESSAGE(STATUS "Using cygwin install path with ${ZIP_EXECUTABLE}")
+    FIND_PROGRAM(ZIP_EXECUTABLE zip PATHS "${CYGWIN_INSTALL_PATH}/bin")
+  ELSE()
+  MESSAGE(STATUS "Using other install path ${ZIP_EXECUTABLE}")
+    FIND_PROGRAM(ZIP_EXECUTABLE zip PATHS "$ENV{PATH}")
+  ENDIF()
+  IF(ZIP_EXECUTABLE)
+    MESSAGE(STATUS "Using ${ZIP_EXECUTABLE}")
+	ADD_CUSTOM_COMMAND(OUTPUT "${ARCHIVE}" 
+	  COMMAND ${ZIP_EXECUTABLE} -r ${ARCHIVE} ${FILELIST}
+      WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
+  ENDIF(ZIP_EXECUTABLE)
+ENDIF(NOT ZIP_EXECUTABLE)
+
+IF(NOT ZIP_EXECUTABLE)
+  IF(JAVA_ARCHIVE)
+    SET(ZIP_EXECUTABLE ${JAVA_ARCHIVE})
+    MESSAGE(STATUS "Using ${ZIP_EXECUTABLE}")
+	ADD_CUSTOM_COMMAND(OUTPUT "${ARCHIVE}" 
+	  COMMAND ${ZIP_EXECUTABLE} cf ${ARCHIVE} ${FILELIST}
+      WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
+  ENDIF()
+ENDIF(NOT ZIP_EXECUTABLE)
+
+ENDMACRO()
+

=== added file 'storage/ndb/mcc/host_info/config.h.in'
--- a/storage/ndb/mcc/host_info/config.h.in	1970-01-01 00:00:00 +0000
+++ b/storage/ndb/mcc/host_info/config.h.in	2012-12-13 12:34:09 +0000
@@ -0,0 +1,26 @@
+/*
+   Copyright (c) 2012, 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
+   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
+*/
+
+#cmakedefine HAVE_UNISTD_H
+#cmakedefine HAVE_WINDOWS_H
+
+#cmakedefine HAVE__SC_PHYS_PAGES
+#cmakedefine HAVE__SC_NPROCESSORS_CONF
+
+#cmakedefine HAVE_GLOBALMEMORYSTATUS
+#cmakedefine HAVE_GLOBALMEMORYSTATUSEX
+#cmakedefine HAVE_GETSYSTEMINFO

=== modified file 'support-files/mysql.spec.sh'
--- a/support-files/mysql.spec.sh	2012-11-23 15:41:48 +0000
+++ b/support-files/mysql.spec.sh	2012-12-13 11:51:36 +0000
@@ -1104,6 +1104,8 @@ echo "====="
 %attr(755, root, root) %{_bindir}/ndb_select_count
 %attr(755, root, root) %{_bindir}/ndb_show_tables
 %attr(755, root, root) %{_bindir}/ndb_waiter
+%attr(755, root, root) %{_bindir}/ndb_setup.py
+%attr(755, root, root) %{_bindir}/ndb_setup
 
 %if %(test "@MEMCACHED_ROOT_DIR@" '!=' "MEMCACHED_ROOT_DIR-NOTFOUND" && echo 1 || echo 0)
 %attr(755, root, root) %{_sbindir}/memcached

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.5-cluster-7.2 branch (bernd.ocklin:4141 to 4146) Bernd Ocklin13 Dec