This is an automated email from the ASF dual-hosted git repository.

kpvdr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-interop-test.git


The following commit(s) were added to refs/heads/master by this push:
     new 693b60e  QPIDIT-139: Further refinements and removing ugly stuff in 
the install, fixed python error around checking env vars
693b60e is described below

commit 693b60ea69f53f6635a28d1654aaf97792270e9f
Author: Kim van der Riet <kp...@apache.org>
AuthorDate: Fri Jan 17 18:06:03 2020 -0500

    QPIDIT-139: Further refinements and removing ugly stuff in the install, 
fixed python error around checking env vars
---
 CMakeLists.txt                           | 22 ++++------------------
 config.sh.in                             |  1 -
 src/python/qpid_interop_test/qit_shim.py |  6 ++++--
 3 files changed, 8 insertions(+), 21 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0622f31..9084cd1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -162,25 +162,11 @@ if(NOT "${retcode}" STREQUAL "0")
     message(FATAL_ERROR "Data code file generation for .Net failed: 
${retcode}")
 endif()
 
+configure_file(config.sh.in config.sh @ONLY)
+
 # Install files using python setup.py
 install(CODE "MESSAGE(STATUS \"Python install dir: 
${CMAKE_INSTALL_PREFIX}/lib/${PYTHON2_DIR_NAME}/site-packages/qpid_interop_test/\")")
 install(CODE "execute_process(COMMAND python setup.py install --prefix 
${CMAKE_INSTALL_PREFIX}
                               WORKING_DIRECTORY ../)")
-
-# This section is temporary - make links from python3.x site-packages dir to 
python2.7 files needed by shims
-# when running under Python 3.x.
-install(CODE "MESSAGE(STATUS \"Python install dir: 
${CMAKE_INSTALL_PREFIX}/lib/${PYTHON3_DIR_NAME}/site-packages/qpid_interop_test/\")")
-install(CODE "execute_process(COMMAND mkdir -p 
${CMAKE_INSTALL_PREFIX}/lib/${PYTHON3_DIR_NAME}/site-packages/qpid_interop_test/
-                              WORKING_DIRECTORY ../)")
-install(CODE "execute_process(COMMAND ln -s 
${CMAKE_INSTALL_PREFIX}/lib/${PYTHON2_DIR_NAME}/site-packages/qpid_interop_test/qit_errors.py
-                                            
${CMAKE_INSTALL_PREFIX}/lib/${PYTHON3_DIR_NAME}/site-packages/qpid_interop_test/qit_errors.py)")
-install(CODE "execute_process(COMMAND ln -s 
${CMAKE_INSTALL_PREFIX}/lib/${PYTHON2_DIR_NAME}/site-packages/qpid_interop_test/qit_jms_types.py
-                                            
${CMAKE_INSTALL_PREFIX}/lib/${PYTHON3_DIR_NAME}/site-packages/qpid_interop_test/qit_jms_types.py)")
-
-# TODO: THIS IS UGLY!
-# Find a way to handle this as part of the Python install process instead
-# Set the following Python scripts to executable:
-install(CODE "execute_process(COMMAND bash -c \"chmod +x *_test.py\"
-                              WORKING_DIRECTORY 
${CMAKE_INSTALL_PREFIX}/lib/${PYTHON2_DIR_NAME}/site-packages/qpid_interop_test/)")
-
-configure_file(config.sh.in config.sh @ONLY)
+install(FILES build/config.sh
+        DESTINATION ${CMAKE_INSTALL_PREFIX}/libexec/qpid_interop_test/)
\ No newline at end of file
diff --git a/config.sh.in b/config.sh.in
index a159a50..18b34a7 100644
--- a/config.sh.in
+++ b/config.sh.in
@@ -18,7 +18,6 @@
 
 # Source this file to set up environment variables for the Qpid interop tests.
 
-export QPID_INTEROP_TEST_HOME=@CMAKE_SOURCE_DIR@
 export QIT_INSTALL_PREFIX=@CMAKE_INSTALL_PREFIX@
 
 # Set PYTHON2PATH and PYTHON3PATH for respective python shims
diff --git a/src/python/qpid_interop_test/qit_shim.py 
b/src/python/qpid_interop_test/qit_shim.py
index 1a4ea97..c1ade1d 100644
--- a/src/python/qpid_interop_test/qit_shim.py
+++ b/src/python/qpid_interop_test/qit_shim.py
@@ -37,9 +37,11 @@ class ShimProcess(subprocess.Popen):
         self.killed_flag = False
         self.env = copy.deepcopy(os.environ)
         if python3_flag:
-            self.env['PYTHONPATH'] = self.env['PYTHON3PATH']
+            if 'PYTHON3PATH' in self.env:
+                self.env['PYTHONPATH'] = self.env['PYTHON3PATH']
         else:
-            self.env['PYTHONPATH'] = self.env['PYTHON2PATH']
+            if 'PYTHON2PATH' in self.env:
+                self.env['PYTHONPATH'] = self.env['PYTHON2PATH']
         super(ShimProcess, self).__init__(params, stdout=subprocess.PIPE, 
stderr=subprocess.PIPE, preexec_fn=os.setsid,
                                           env=self.env)
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org

Reply via email to