forked from ungleich-public/cdist
		
	add support for --target-release for __package_apt
Signed-off-by: Nico Schottelius <nico@freiheit.schottelius.org>
This commit is contained in:
		
					parent
					
						
							
								00d5524af9
							
						
					
				
			
			
				commit
				
					
						dd562befc9
					
				
			
		
					 4 changed files with 14 additions and 2 deletions
				
			
		| 
						 | 
					@ -67,7 +67,7 @@ DONE
 | 
				
			||||||
      if [ "$upload_file" ]; then
 | 
					      if [ "$upload_file" ]; then
 | 
				
			||||||
         echo upload >> "$__messages_out"
 | 
					         echo upload >> "$__messages_out"
 | 
				
			||||||
         cat << DONE
 | 
					         cat << DONE
 | 
				
			||||||
$__remote_copy $source ${__target_host}:\$destination_upload
 | 
					$__remote_copy "$source" "${__target_host}:\$destination_upload"
 | 
				
			||||||
DONE
 | 
					DONE
 | 
				
			||||||
      fi
 | 
					      fi
 | 
				
			||||||
# move uploaded file into place
 | 
					# move uploaded file into place
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -33,6 +33,14 @@ else
 | 
				
			||||||
   state_should="present"
 | 
					   state_should="present"
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [ -f "$__object/parameter/target-release" ]; then
 | 
				
			||||||
 | 
					   target_release="--target-release $(cat "$__object/parameter/target-release")"
 | 
				
			||||||
 | 
					else
 | 
				
			||||||
 | 
					   target_release=""
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# FIXME: use grep directly, state is a list, not a line!
 | 
					# FIXME: use grep directly, state is a list, not a line!
 | 
				
			||||||
state_is="$(cat "$__object/explorer/state")"
 | 
					state_is="$(cat "$__object/explorer/state")"
 | 
				
			||||||
case "$state_is" in
 | 
					case "$state_is" in
 | 
				
			||||||
| 
						 | 
					@ -50,7 +58,7 @@ aptget="DEBIAN_FRONTEND=noninteractive apt-get --quiet --yes --no-install-recomm
 | 
				
			||||||
 | 
					
 | 
				
			||||||
case "$state_should" in
 | 
					case "$state_should" in
 | 
				
			||||||
    present)
 | 
					    present)
 | 
				
			||||||
        echo $aptget install \"$name\"
 | 
					        echo $aptget install $target_release \"$name\"
 | 
				
			||||||
    ;;
 | 
					    ;;
 | 
				
			||||||
    absent)
 | 
					    absent)
 | 
				
			||||||
        echo $aptget remove \"$name\"
 | 
					        echo $aptget remove \"$name\"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -27,6 +27,9 @@ name::
 | 
				
			||||||
state::
 | 
					state::
 | 
				
			||||||
    Either "present" or "absent", defaults to "present"
 | 
					    Either "present" or "absent", defaults to "present"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					target-release::
 | 
				
			||||||
 | 
					    Passed on to apt-get install, see apt-get(8).
 | 
				
			||||||
 | 
					    Essentially allows you to retrieve packages from a different release
 | 
				
			||||||
 | 
					
 | 
				
			||||||
EXAMPLES
 | 
					EXAMPLES
 | 
				
			||||||
--------
 | 
					--------
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,3 +1,4 @@
 | 
				
			||||||
name
 | 
					name
 | 
				
			||||||
version
 | 
					version
 | 
				
			||||||
state
 | 
					state
 | 
				
			||||||
 | 
					target-release
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue