diff --git a/sample/components/independent_test_1.bash b/sample/components/independent_test_1.bash index 32dd3e9..e98115f 100755 --- a/sample/components/independent_test_1.bash +++ b/sample/components/independent_test_1.bash @@ -1,7 +1,7 @@ #!/usr/bin/bash # echo test from script -/usr/bin/dialog --title "This should be one argument" --inputbox "Enter your name:" 0 0 +#/usr/bin/dialog --title "This should be one argument" --inputbox "Enter your name:" 0 0 diff --git a/sample/environments/rex.variables b/sample/environments/rex.variables index 235542f..4008dd8 100755 --- a/sample/environments/rex.variables +++ b/sample/environments/rex.variables @@ -1,9 +1,5 @@ #!/usr/bin/bash - - - - set -a echo "variables file says hello and set a variable named TEST_VAR" diff --git a/sample/plans/test.plan b/sample/plans/test.plan index 951198e..0523995 100755 --- a/sample/plans/test.plan +++ b/sample/plans/test.plan @@ -1,5 +1,6 @@ { "plan": [ - { "name": "independent test 1", "dependencies": [ null ] } + { "name": "independent test 1", "dependencies": [ null ] }, + { "name": "independent test 2", "dependencies": [ null ] } ] } diff --git a/sample/units/new.units b/sample/units/new.units index 20df49b..cfcdb0f 100755 --- a/sample/units/new.units +++ b/sample/units/new.units @@ -17,6 +17,24 @@ "group": "$USER", "supply_environment": true, "environment": "environments/rex.variables" + }, + { + "name": "independent test 2", + "target": "components/independent_test_1.bash --ls -s --arg", + "is_shell_command": true, + "shell_definition": "bash", + "force_pty": true, + "set_working_directory": false, + "working_directory": "", + "rectify": false, + "rectifier": "echo rectifier executed", + "active": true, + "required": true, + "set_user_context": true, + "user": "$USER", + "group": "$USER", + "supply_environment": true, + "environment": "environments/rex.variables" } ] } diff --git a/src/lcpex/liblcpex.cpp b/src/lcpex/liblcpex.cpp index f494a6f..b0e033e 100644 --- a/src/lcpex/liblcpex.cpp +++ b/src/lcpex/liblcpex.cpp @@ -321,11 +321,6 @@ int execute( close(watched_fds[this_fd].fd); break_out = true; } -// if (watched_fds[this_fd].revents & POLLHUP) { -// // this pipe has hung up -// close(watched_fds[this_fd].fd); -// break_out = true; -// } if (watched_fds[this_fd].revents & POLLHUP) { // this pipe has hung up // don't close the file descriptor yet, there might still be data to read diff --git a/src/lcpex/vpty/libclpex_tty.cpp b/src/lcpex/vpty/libclpex_tty.cpp index f2502c1..a423535 100644 --- a/src/lcpex/vpty/libclpex_tty.cpp +++ b/src/lcpex/vpty/libclpex_tty.cpp @@ -108,7 +108,7 @@ int exec_pty( // before we fork the process, so that the child process will inherit the environment // from the parent process if ( environment_supplied ) { - clearenv(); + //clearenv(); } // turn our command string into something execvp can consume diff --git a/src/misc/helpers.cpp b/src/misc/helpers.cpp index e25ff82..5f36e59 100644 --- a/src/misc/helpers.cpp +++ b/src/misc/helpers.cpp @@ -101,10 +101,22 @@ std::string get_8601() * * @param text The input text to be processed */ +//void interpolate( std::string & text ) +//{ +// static std::regex env1( "\\$\\{([^}]+)\\}" ); +// static std::regex env2( "\\$([^/]+)" ); // matches $VAR_NAME until a / is found +// std::smatch match; +// while ( std::regex_search( text, match, env1 ) || std::regex_search( text, match, env2 ) ) +// { +// const char * s = getenv( match[1].str().c_str() ); +// const std::string var( s == NULL ? "" : s ); +// text.replace( match[0].first, match[0].second, var ); +// } +//} void interpolate( std::string & text ) { - static std::regex env1( "\\$\\{([^}]+)\\}" ); - static std::regex env2( "\\$([^/]+)" ); // matches $VAR_NAME until a / is found + std::regex env1( "\\$\\{([^}]+)\\}" ); + std::regex env2( "\\$([^/]+)" ); // matches $VAR_NAME until a / is found std::smatch match; while ( std::regex_search( text, match, env1 ) || std::regex_search( text, match, env2 ) ) {