Commit a8265c60 authored by bonnell's avatar bonnell
Browse files

merge from 2.0RC R10506

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@10508 18c085ea-50e0-402c-830e-de6fd14e8384
parent 104f894c
......@@ -52,6 +52,9 @@
# Kathleen Bonnell, Wed Mar 17 10:01:22 MT 2010
# Exclude '.svn' from being included when installing directories.
#
# Kathleen Bonnell, Wed Mar 24 16:26:32 MST 2010
# Change install on windows due to different directory structure.
#
#****************************************************************************/
INCLUDE(${VISIT_SOURCE_DIR}/CMake/ThirdPartyInstallLibrary.cmake)
......@@ -299,17 +302,50 @@ IF(PYTHONLIBS_FOUND)
PATTERN "*.pyo" EXCLUDE
PATTERN "lib-tk" EXCLUDE
PATTERN "visit*" EXCLUDE
PATTERN "Python-2.5-py2.5.egg-info" EXCLUDE
PATTERN "Python-2.6-py2.6.egg-info" EXCLUDE
)
ENDIF(EXISTS ${PYTHON_DIR}/lib/python${PYTHON_VERSION})
# Install the Python headers
INSTALL(DIRECTORY ${PYTHON_INCLUDE_PATH}
DESTINATION ${VISIT_INSTALLED_VERSION_INCLUDE}/python/include
FILE_PERMISSIONS OWNER_WRITE OWNER_READ GROUP_WRITE GROUP_READ WORLD_READ
DIRECTORY_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_WRITE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
PATTERN ".svn" EXCLUDE
)
IF (NOT WIN32)
INSTALL(DIRECTORY ${PYTHON_INCLUDE_PATH}
DESTINATION ${VISIT_INSTALLED_VERSION_INCLUDE}/python/include
FILE_PERMISSIONS OWNER_READ OWNER_WRITE
GROUP_READ GROUP_WRITE
WORLD_READ
DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_WRITE GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
PATTERN ".svn" EXCLUDE
)
ELSE (NOT WIN32)
INSTALL(DIRECTORY ${PYTHON_INCLUDE_PATH}/
DESTINATION ${VISIT_INSTALLED_VERSION_INCLUDE}/python
FILE_PERMISSIONS OWNER_READ OWNER_WRITE
GROUP_READ GROUP_WRITE
WORLD_READ
DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_WRITE GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
FILES_MATCHING PATTERN "*.h"
PATTERN ".svn" EXCLUDE
)
INSTALL(DIRECTORY ${VISIT_PYTHON_DIR}/lib
DESTINATION ${VISIT_INSTALLED_VERSION_LIB}/python
FILE_PERMISSIONS OWNER_READ OWNER_WRITE
GROUP_READ GROUP_WRITE
WORLD_READ
DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_WRITE GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
PATTERN "*.pyc" EXCLUDE
PATTERN "*.pyo" EXCLUDE
PATTERN "lib-tk" EXCLUDE
PATTERN "visit*" EXCLUDE
PATTERN ".svn" EXCLUDE
PATTERN "Python-2.6-py2.6.egg-info" EXCLUDE
)
ENDIF (NOT WIN32)
ENDIF((NOT ${PYTHON_DIR} STREQUAL "/usr"))
ENDIF(Python_FRAMEWORKS)
ENDIF(PYTHONLIBS_FOUND)
......
......@@ -300,7 +300,7 @@ IF(WIN32)
SET(APPENDED_VISIT_VERSION_TO_INSTALL_PATH TRUE CACHE INTERNAL "")
ENDIF( NOT APPENDED_VISIT_VERSION_TO_INSTALL_PATH)
SET(VISIT_INSTALLED_VERSION ${CMAKE_INSTALL_PREFIX}
CACHE PATH "VisIt install directory")
CACHE PATH "VisIt install directory" FORCE)
SET(VISIT_INSTALLED_VERSION_BIN ${CMAKE_INSTALL_PREFIX}
CACHE PATH "VisIt bin install directory" FORCE)
SET(VISIT_INSTALLED_VERSION_LIB ${CMAKE_INSTALL_PREFIX}/lib
......@@ -311,8 +311,8 @@ IF(WIN32)
CACHE PATH "VisIt help install directory" FORCE)
SET(VISIT_INSTALLED_VERSION_PLUGINS ${CMAKE_INSTALL_PREFIX}
CACHE PATH "VisIt plugins install directory" FORCE)
SET(VISIT_INSTALLED_VERSION_ARCHIVES ${CMAKE_INSTALL_PREFIX}/archives
CACHE PATH "3rd party I/O archives install directory")
SET(VISIT_INSTALLED_VERSION_ARCHIVES ${CMAKE_INSTALL_PREFIX}/lib
CACHE PATH "3rd party I/O archives install directory" FORCE)
ELSE(WIN32)
INCLUDE(${VISIT_SOURCE_DIR}/CMake/DetermineVisItArchitecture.cmake)
DETERMINE_VISIT_ARCHITECTURE(VISIT_INSTALL_PLATFORM)
......@@ -363,7 +363,9 @@ MACRO(VISIT_INSTALL_TARGETS)
BUNDLE DESTINATION ${VISIT_INSTALLED_VERSION_BIN}
LIBRARY DESTINATION ${VISIT_INSTALLED_VERSION_LIB}
ARCHIVE DESTINATION ${VISIT_INSTALLED_VERSION_ARCHIVES}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_WRITE GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
CONFIGURATIONS "";None;Debug;Release;RelWithDebInfo;MinSizeRel
)
ENDIF(NOT ${pType} STREQUAL "STATIC_LIBRARY")
......@@ -374,7 +376,9 @@ MACRO(VISIT_INSTALL_TARGETS)
BUNDLE DESTINATION ${VISIT_INSTALLED_VERSION_BIN}
LIBRARY DESTINATION ${VISIT_INSTALLED_VERSION_LIB}
ARCHIVE DESTINATION ${VISIT_INSTALLED_VERSION_ARCHIVES}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_WRITE GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
CONFIGURATIONS "";None;Debug;Release;RelWithDebInfo;MinSizeRel
)
IF(APPLE)
......@@ -424,7 +428,9 @@ MACRO(VISIT_INSTALL_PLUGINS type)
INSTALL(TARGETS ${ARGN}
LIBRARY DESTINATION ${VISIT_INSTALLED_VERSION_PLUGINS}/${type}
RUNTIME DESTINATION ${VISIT_INSTALLED_VERSION_PLUGINS}/${type}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_WRITE GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
CONFIGURATIONS "";None;Debug;Release;RelWithDebInfo;MinSizeRel
)
ELSE(NOT WIN32)
......@@ -437,7 +443,9 @@ MACRO(VISIT_INSTALL_PLUGINS type)
INSTALL(FILES ${filename}
DESTINATION ${VISIT_INSTALLED_VERSION_PLUGINS}/${type}
COMPONENT RUNTIME
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_WRITE GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
CONFIGURATIONS "";None;Debug;Release;RelWithDebInfo;MinSizeRel
)
ENDFOREACH(target)
......@@ -471,8 +479,12 @@ ENDMACRO(VISIT_INSTALL_PLOT_PLUGINS)
# Install the headers for directories that we need in order to build plugins
INSTALL(DIRECTORY avt common engine gui launcher mdserver third_party_builtin viewer visit_vtk visitpy vtkqt winutil
DESTINATION ${VISIT_INSTALLED_VERSION_INCLUDE}/visit
FILE_PERMISSIONS OWNER_WRITE OWNER_READ GROUP_WRITE GROUP_READ WORLD_READ
DIRECTORY_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_WRITE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
FILE_PERMISSIONS OWNER_READ OWNER_WRITE
GROUP_READ GROUP_WRITE
WORLD_READ
DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_WRITE GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
CONFIGURATIONS "";None;Debug;Release;RelWithDebInfo;MinSizeRel
FILES_MATCHING PATTERN "*.h"
PATTERN ".svn" EXCLUDE
......@@ -718,7 +730,9 @@ ELSE(CMAKE_HOST_UNIX)
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ThirdParty)
INSTALL(FILES ${ZLIB_LIBRARY_DIR}/zlib1.dll
DESTINATION ${VISIT_INSTALLED_VERSION_BIN}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_WRITE GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
CONFIGURATIONS "";None;Debug;Release;RelWithDebInfo;MinSizeRel
)
......@@ -1201,7 +1215,9 @@ CONFIGURE_FILE(${VISIT_SOURCE_DIR}/CMake/PluginVsInstall.cmake.in
${VISIT_BINARY_DIR}/CMake/PluginVsInstall.cmake @ONLY IMMEDIATE)
INSTALL(FILES ${VISIT_BINARY_DIR}/CMake/PluginVsInstall.cmake
DESTINATION ${VISIT_INSTALLED_VERSION_INCLUDE}
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ GROUP_WRITE WORLD_READ
PERMISSIONS OWNER_READ OWNER_WRITE
GROUP_READ GROUP_WRITE
WORLD_READ
)
#-----------------------------------------------------------------------------
......@@ -1347,6 +1363,9 @@ ENDIF(NOT WIN32 AND IS_DIRECTORY ${VISIT_SOURCE_DIR}/../data)
# CPack -- This leverages our install targets to provide a "make package" that
# packages up a VisIt distribution.
#-----------------------------------------------------------------------------
# temporarily turn this off on windows
IF (NOT WIN32)
SET(CPACK_PACKAGE_NAME "visit")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "VisIt ${VISIT_VERSION} is a parallel visualization and data analysis tool")
SET(CPACK_PACKAGE_VENDOR "LLNS")
......@@ -1357,16 +1376,17 @@ SET(CPACK_PACKAGE_VERSION_MAJOR "2")
SET(CPACK_PACKAGE_VERSION_MINOR "0")
SET(CPACK_PACKAGE_VERSION_PATCH "0")
IF(WIN32)
SET(CPACK_PACKAGE_FILE_NAME "visit${VISIT_VERSION}")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "VisIt ${VISIT_VERSION}")
SET(CPACK_GENERATOR "NSIS")
ELSE(WIN32)
#IF(WIN32)
# SET(CPACK_PACKAGE_FILE_NAME "visit${VISIT_VERSION}")
# SET(CPACK_PACKAGE_INSTALL_DIRECTORY "VisIt ${VISIT_VERSION}")
#
# SET(CPACK_GENERATOR "NSIS")
#ELSE(WIN32)
STRING(REPLACE "." "_" UL_VERSION ${VISIT_VERSION})
SET(CPACK_PACKAGE_FILE_NAME "visit${UL_VERSION}.${VISIT_INSTALL_PLATFORM}")
SET(CPACK_GENERATOR "TGZ")
SET(CPACK_STRIP_FILES TRUE)
ENDIF(WIN32)
#ENDIF(WIN32)
INCLUDE(CPack)
ENDIF (NOT WIN32)
......@@ -191,12 +191,16 @@ PythonInterpreter::Shutdown()
// Programmer: Cyrus Harrison
// Creation: May 2, 2008
//
// Modifications:
// Kathleen Bonnell, Wed Mar 24 16:19:44 MST 2010
// Use raw string.
//
// ****************************************************************************
bool
PythonInterpreter::AddSystemPath(const std::string &path)
{
return RunScript("sys.path.insert(1,'" + path + "')\n");
return RunScript("sys.path.insert(1,r'" + path + "')\n");
}
// ****************************************************************************
......
......@@ -45,6 +45,7 @@
#include <DebugStream.h>
#include <Environment.h>
#include <StringHelpers.h>
#include <InstallationFunctions.h>
using namespace std;
......@@ -89,6 +90,11 @@ avtPythonFilterEnvironment::~avtPythonFilterEnvironment()
// Programmer: Cyrus Harrison
// Creation: Tue Feb 2 13:14:44 PST 2010
//
// Modifications:
// Kathleen Bonnell, Wed Mar 24 16:17:23 MST 2010
// Retrieve VISITARCHHOME via GetVisItArchitectureDirectory.
// Remove slash from end of paths passed to AddSystemPath.
//
// ****************************************************************************
bool
......@@ -99,9 +105,10 @@ avtPythonFilterEnvironment::Initialize()
return false;
// setup pyavt env:
// add system paths: $VISITARCHOME/lib & $VISITARCHOME/lib/site-packages
string varchdir = Environment::get("VISITARCHHOME");
string vlibdir = varchdir + VISIT_SLASH_CHAR + "lib" + VISIT_SLASH_CHAR;
string vlibsp = vlibdir + "site-packages" + VISIT_SLASH_CHAR;
string varchdir = GetVisItArchitectureDirectory();
string vlibdir = varchdir + VISIT_SLASH_CHAR + "lib";
string vlibsp = vlibdir + VISIT_SLASH_CHAR + "site-packages";
if(!pyi->AddSystemPath(vlibdir))
return false;
if(!pyi->AddSystemPath(vlibsp)) // vtk module is symlinked here
......
......@@ -46,6 +46,10 @@
# Change copy_directory for VISIT_BIN_DIRECTORIES to a FILE(COPY
# so that '.svn' can be skipped.
#
# Kathleen Bonnell, Mon Mar 22 11:08:46 MST 2010
# Don't copy VISIT_BIN_FILES on windows, instead only copy makemovie.py,
# makemoviemain.py and visitdiff.py.
#
#****************************************************************************/
#-----------------------------------------------------------------------------
......@@ -94,17 +98,31 @@ FOREACH(VISIT_BIN_ITEM ${VISIT_BIN_DIRECTORIES})
PATTERN ".svn" EXCLUDE)
ENDFOREACH(VISIT_BIN_ITEM)
FOREACH(VISIT_BIN_ITEM ${VISIT_BIN_FILES} internallauncher)
EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/${VISIT_BIN_ITEM}
${CMAKE_CURRENT_BINARY_DIR}/${VISIT_BIN_ITEM})
ENDFOREACH(VISIT_BIN_ITEM)
IF (NOT WIN32)
FOREACH(VISIT_BIN_ITEM ${VISIT_BIN_FILES} internallauncher)
EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/${VISIT_BIN_ITEM}
${CMAKE_CURRENT_BINARY_DIR}/${VISIT_BIN_ITEM})
ENDFOREACH(VISIT_BIN_ITEM)
#-----------------------------------------------------------------------------
# Create VisIt launcher binary for windows
#----------------------------------------------------------------------------
IF(WIN32)
INSTALL(FILES ${VISIT_BIN_FILES}
DESTINATION bin
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_WRITE GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE)
INSTALL(FILES internallauncher
DESTINATION ${VISIT_VERSION}/bin
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_WRITE GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE)
ELSE (NOT WIN32)
#--------------------------------------------------------------------------
# Create VisIt launcher binary for windows
#--------------------------------------------------------------------------
INCLUDE_DIRECTORIES(${VISIT_COMMON_INCLUDES})
LINK_DIRECTORIES(${LIBRARY_OUTPUT_DIRECTORY})
ADD_EXECUTABLE(visit_exe visit.c)
......@@ -112,22 +130,38 @@ IF(WIN32)
SET_SOURCE_FILES_PROPERTIES(visit.c PROPERTIES LANGUAGE CXX)
TARGET_LINK_LIBRARIES(visit_exe shlwapi)
VISIT_INSTALL_TARGETS(visit_exe)
ENDIF(WIN32)
#--------------------------------------------------------------------------
# Copy movie helper scripts
#--------------------------------------------------------------------------
SET(VISIT_BIN_WIN_FILES
${CMAKE_CURRENT_SOURCE_DIR}/makemovie.py
${CMAKE_CURRENT_SOURCE_DIR}/makemoviemain.py
${CMAKE_CURRENT_SOURCE_DIR}/visitdiff.py)
INSTALL(FILES ${VISIT_BIN_FILES}
DESTINATION bin
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
IF(NOT WIN32)
INSTALL(FILES internallauncher
DESTINATION ${VISIT_VERSION}/bin
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
INSTALL(FILES ${VISIT_BIN_WIN_FILES}
DESTINATION ${VISIT_INSTALLED_VERSION}
PERMISSIONS OWNER_READ OWNER_WRITE
GROUP_READ GROUP_WRITE
WORLD_READ)
FOREACH (CFG Release Debug RelWithDebuInfo MinSizeRel)
FILE(COPY ${VISIT_BIN_WIN_FILES}
DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CFG}
FILE_PERMISSIONS OWNER_READ OWNER_WRITE
GROUP_READ GROUP_WRITE
WORLD_READ)
ENDFOREACH (CFG)
ENDIF(NOT WIN32)
INSTALL(DIRECTORY movietemplates translations
DESTINATION ${VISIT_INSTALLED_VERSION_BIN}
FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ GROUP_WRITE WORLD_READ
DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
FILE_PERMISSIONS OWNER_READ OWNER_WRITE
GROUP_READ GROUP_WRITE
WORLD_READ
DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_WRITE GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
PATTERN ".svn" EXCLUDE
)
......@@ -775,6 +775,9 @@ ReadKey(const char *key, char **keyval)
* Kathleen Bonnell, Wed Feb 3 13:59:42 PST 2010
* Removed use of VISITDEVDIR env var.
*
* Kathleen Bonnell, Wed Mar 24 16:21:03 MST 2010
* Check for VISITHOME in env. Set PYTHONPATH.
*
*****************************************************************************/
char *
......@@ -792,6 +795,14 @@ AddEnvironment(int useShortFileName)
*/
haveVISITHOME = ReadKey("VISITHOME", &visitpath);
if (!haveVISITHOME)
{
free(visitpath);
visitpath = 0;
if ((visitpath = getenv("VISITHOME")) != NULL)
haveVISITHOME = 1;
}
/*
* We could not get the value associated with the key. It may mean
* that VisIt was not installed properly. Use a default value.
......@@ -929,6 +940,12 @@ AddEnvironment(int useShortFileName)
sprintf(tmp, "VISITULTRAHOME=%s\\ultrawrapper", visitpath);
putenv(tmp);
/*
* Set PYTHONPATH
*/
sprintf(tmp, "PYTHONPATH=%s\\lib\\Python\\lib", visitpath);
putenv(tmp);
/*
* Set the SSH program.
*/
......
......@@ -51,6 +51,7 @@
#include <visit-config.h>
#include <sstream>
#include <Environment.h>
#include <InstallationFunctions.h>
#include <iostream>
using namespace std;
......@@ -321,13 +322,15 @@ QvisPythonFilterEditor::loadMenuEvent(QAction *action)
// Creation: Thu Feb 11 09:35:54 PST 2010
//
// Modifications:
// Kathleen Bonnell, Wed Mar 24 16:28:37 MST 2010
// Retrieve VISITARCHHOME via GetVisItArchitectureDirectory.
//
// ****************************************************************************
QString
QvisPythonFilterEditor::templateDirectory()
{
QString res(Environment::get("VISITARCHHOME").c_str());
QString res(GetVisItArchitectureDirectory().c_str());
res += QString(VISIT_SLASH_CHAR)
+ QString("lib")
+ QString(VISIT_SLASH_CHAR)
......
......@@ -38,6 +38,10 @@
# Kathleen Bonnell, Thu Feb 25 10:59 MST 2010
# Exclude testmds on windows.
#
# Kathleen Bonnell, Tue Mar 23 11:51:02 MST 2010
# Put install of mdserver outside of NOT WIN32 loop so it will get installed
# on windows.
#
#****************************************************************************/
SET(MDSERVER_SOURCES
......@@ -128,8 +132,8 @@ IF(VISIT_STATIC)
ENDIF(VISIT_STATIC)
IF (NOT WIN32)
ADD_EXECUTABLE(testmds EXCLUDE_FROM_ALL testmds.C LibPipelineStubs.C)
TARGET_LINK_LIBRARIES(testmds mdserverproxy mdserverrpc visitcommon avtdbatts)
ADD_EXECUTABLE(testmds EXCLUDE_FROM_ALL testmds.C LibPipelineStubs.C)
TARGET_LINK_LIBRARIES(testmds mdserverproxy mdserverrpc visitcommon avtdbatts)
ENDIF (NOT WIN32)
VISIT_INSTALL_TARGETS(mdserver)
ENDIF (NOT WIN32)
......@@ -144,6 +144,9 @@ extern "C" VISITCLI_API int Py_Main(int, char **);
// Added book keeping to track execution stack of source files and the
// script file passed via the '-s' command line option.
//
// Kathleen Bonnell, Wed Mar 24 08:20:01 MST 2010
// Fix pointer overwrite problem when both "-s" and "-o" are used on Windows
//
// ****************************************************************************
int
......@@ -209,8 +212,8 @@ main(int argc, char *argv[])
break;
}
i += (nArgsSkip -1);
// We want to remove the beginning and ending quotes, to ensure proper
// operation further on.
// We want to remove the beginning and ending quotes, to
// ensure proper operation further on.
strncpy(tmpArg, tmpArg+1, tmplen-2);
tmpArg[tmplen-2] = '\0';
}
......@@ -220,12 +223,14 @@ main(int argc, char *argv[])
}
if (runF)
{
runFile = tmpArg;
runFile = new char [strlen(tmpArg)+1];
sprintf(runFile, "%s", tmpArg);
s_found = true;
}
else
{
loadFile = tmpArg;
loadFile = new char [strlen(tmpArg)+1];
sprintf(loadFile, "%s", tmpArg);
}
}
#else
......@@ -346,6 +351,9 @@ main(int argc, char *argv[])
sprintf(command, "OpenDatabase(\"%s\")", loadFile);
PyRun_SimpleString(command);
delete [] command;
#ifdef WIN32
delete [] loadFile;
#endif
}
......@@ -362,6 +370,9 @@ main(int argc, char *argv[])
PyRun_SimpleString(pycmd.c_str());
cli_runscript(runFile);
#ifdef WIN32
delete [] runFile;
#endif
}
// Enter the python interpreter loop.
......
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