forked from ungleich-public/cdist
		
	Merge branch '__package_pip_detect_pip_bin' into 'master'
[__package_pip] detect pip binary See merge request ungleich-public/cdist!935
This commit is contained in:
		
				commit
				
					
						139a782c96
					
				
			
		
					 3 changed files with 17 additions and 2 deletions
				
			
		
							
								
								
									
										10
									
								
								cdist/conf/type/__package_pip/explorer/pip
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										10
									
								
								cdist/conf/type/__package_pip/explorer/pip
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
					@ -0,0 +1,10 @@
 | 
				
			||||||
 | 
					#!/bin/sh -e
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					for bin in pip3 pip
 | 
				
			||||||
 | 
					do
 | 
				
			||||||
 | 
					    if check="$( command -v "$bin" )"
 | 
				
			||||||
 | 
					    then
 | 
				
			||||||
 | 
					        echo "$check"
 | 
				
			||||||
 | 
					        break
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					done
 | 
				
			||||||
| 
						 | 
					@ -32,7 +32,7 @@ pipparam="$__object/parameter/pip"
 | 
				
			||||||
if [ -f "$pipparam" ]; then
 | 
					if [ -f "$pipparam" ]; then
 | 
				
			||||||
    pip=$(cat "$pipparam")
 | 
					    pip=$(cat "$pipparam")
 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
    pip="pip"
 | 
					    pip="$( "$__type_explorer/pip" )"
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# If there is no pip, it may get created from somebody else.
 | 
					# If there is no pip, it may get created from somebody else.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -38,7 +38,12 @@ pipparam="$__object/parameter/pip"
 | 
				
			||||||
if [ -f "$pipparam" ]; then
 | 
					if [ -f "$pipparam" ]; then
 | 
				
			||||||
    pip=$(cat "$pipparam")
 | 
					    pip=$(cat "$pipparam")
 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
    pip="pip"
 | 
					    pip="$( cat "$__object/explorer/pip" )"
 | 
				
			||||||
 | 
					    if [ -z "$pip" ]
 | 
				
			||||||
 | 
					    then
 | 
				
			||||||
 | 
					        echo 'pip not found in path' >&2
 | 
				
			||||||
 | 
					        exit 1
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
runasparam="$__object/parameter/runas"
 | 
					runasparam="$__object/parameter/runas"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue