only setup path when executing something, not generally
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
		
					parent
					
						
							
								97e8c431af
							
						
					
				
			
			
				commit
				
					
						160d85dee1
					
				
			
		
					 3 changed files with 5 additions and 7 deletions
				
			
		| 
						 | 
					@ -18,7 +18,8 @@
 | 
				
			||||||
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
 | 
					# along with cdist. If not, see <http://www.gnu.org/licenses/>.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Exec the code for the given object locally and remote
 | 
					# Test whether something is executable (that should be executable) or
 | 
				
			||||||
 | 
					# is missing
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
 | 
					
 | 
				
			||||||
__cdist_is_executable()
 | 
					__cdist_is_executable()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -45,13 +45,9 @@ __cdist_manifest_run()
 | 
				
			||||||
   # The actual run
 | 
					   # The actual run
 | 
				
			||||||
   #
 | 
					   #
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   # Ensure binaries exist and are up-to-date
 | 
					   # Ensure binaries are existing
 | 
				
			||||||
   # FIXME: do only once! no need to check for every manifest!
 | 
					 | 
				
			||||||
   __cdist_type_build_emulation "${__cdist_out_type_bin_dir}" \
 | 
					   __cdist_type_build_emulation "${__cdist_out_type_bin_dir}" \
 | 
				
			||||||
      || __cdist_exit_err "Failed to build type emulation binaries"
 | 
					      || __cdist_exit_err "Failed to build type emulation binaries"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   # prepend our path, so all cdist tools come before other tools
 | 
					 | 
				
			||||||
   export PATH="${__cdist_out_type_bin_dir}:$PATH"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
   __cdist_run_shell "${__cdist_manifest}"
 | 
					   __cdist_run_shell "${__cdist_manifest}"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -24,7 +24,8 @@
 | 
				
			||||||
__cdist_run_shell()
 | 
					__cdist_run_shell()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
   set +e
 | 
					   set +e
 | 
				
			||||||
   sh -e "$@"
 | 
					   # Prepend our path, so all cdist tools come before other tools
 | 
				
			||||||
 | 
					   PATH="${__cdist_out_type_bin_dir}:$PATH" sh -e "$@"
 | 
				
			||||||
   if [ "$?" -ne 0 ]; then
 | 
					   if [ "$?" -ne 0 ]; then
 | 
				
			||||||
      __cdist_echo error  "$1 exited non-zero"
 | 
					      __cdist_echo error  "$1 exited non-zero"
 | 
				
			||||||
      __cdist_echo warn "Faulty code:"
 | 
					      __cdist_echo warn "Faulty code:"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue