commit/galaxy-central: greg: Only source a tool dependency environment file at run time if it exists.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/df0aa9fdb10b/ Changeset: df0aa9fdb10b User: greg Date: 2013-12-06 20:03:27 Summary: Only source a tool dependency environment file at run time if it exists. Affected #: 3 files diff -r 21d10df2729be014ef42db833ae73ff2f39e2d19 -r df0aa9fdb10beafde21f3619cc0f30e224cbac2d lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py --- a/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py +++ b/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py @@ -56,7 +56,7 @@ changed_value = '$%s:%s' % ( env_var_name, env_var_value ) line = "%s=%s; export %s" % ( env_var_name, changed_value, env_var_name ) elif env_var_action == "source": - line = ". %s" % env_var_value + line = "if [ -f %s ] ; then . %s ; fi" % ( env_var_value, env_var_value ) else: raise Exception( "Unknown shell file action %s" % env_var_action ) env_shell_file_path = os.path.join( install_dir, 'env.sh' ) diff -r 21d10df2729be014ef42db833ae73ff2f39e2d19 -r df0aa9fdb10beafde21f3619cc0f30e224cbac2d test/unit/tool_shed/test_fabric_util.py --- a/test/unit/tool_shed/test_fabric_util.py +++ b/test/unit/tool_shed/test_fabric_util.py @@ -23,7 +23,7 @@ mock_return["value"] = 1 env_file_builder.append_line( action="source", value="/usr/bin/local/R/env.sh" ) - assert added_lines == [ ". /usr/bin/local/R/env.sh" ] + assert added_lines == [ "if [ -f /usr/bin/local/R/env.sh ] ; then . /usr/bin/local/R/env.sh ; fi" ] # Check failure assert env_file_builder.return_code == 1 diff -r 21d10df2729be014ef42db833ae73ff2f39e2d19 -r df0aa9fdb10beafde21f3619cc0f30e224cbac2d test/unit/tool_shed/test_td_common_util.py --- a/test/unit/tool_shed/test_td_common_util.py +++ b/test/unit/tool_shed/test_td_common_util.py @@ -32,7 +32,7 @@ line, path = env_file_builder.create_or_update_env_shell_file( TEST_INSTALL_DIR, dict( action="source", value=test_path ) ) assert path == join( TEST_INSTALL_DIR, "env.sh" ) - assert line == ". /usr/share/R/libs" + assert line == "if [ -f /usr/share/R/libs ] ; then . /usr/share/R/libs ; fi" def test_get_env_shell_file_paths_from_setup_environment_elem(): xml = """<action name="setup_r_environment"> Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org