forked from ungleich-public/cdist
		
	update to work with new variables
Signed-off-by: Steven Armstrong <steven.armstrong@inf.ethz.ch>
This commit is contained in:
		
					parent
					
						
							
								4c447b59ac
							
						
					
				
			
			
				commit
				
					
						fe5e0c7541
					
				
			
		
					 4 changed files with 19 additions and 18 deletions
				
			
		| 
						 | 
					@ -1,7 +0,0 @@
 | 
				
			||||||
install/pacman:
 | 
					 | 
				
			||||||
pacman --noconfirm --noprogressbar -S
 | 
					 | 
				
			||||||
--------------------------------------------------------------------------------
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
ensure: What state the package should be in: present | absent | latest | versionstring (1.0.3)
 | 
					 | 
				
			||||||
name: The package name as used by the packaging system
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					@ -23,21 +23,28 @@
 | 
				
			||||||
# system.
 | 
					# system.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
 | 
					
 | 
				
			||||||
. cdist-config
 | 
					type="$__object/parameter/type"
 | 
				
			||||||
 | 
					if [ -f "$type" ]; then
 | 
				
			||||||
object_id="$1"; shift
 | 
					   type="$(cat "$type")"
 | 
				
			||||||
 | 
					 | 
				
			||||||
if [ -f type ]; then
 | 
					 | 
				
			||||||
   type="$(cat type)"
 | 
					 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
   # Default to value taken from explorer
 | 
					   # By default determine package manager based on operating system
 | 
				
			||||||
   type="$(cat $__cdist_out_explorers/pkg_system)"
 | 
					   os="$(cat "out/explorer/os")"
 | 
				
			||||||
 | 
					   case "$os" in
 | 
				
			||||||
 | 
					         archlinux) type="pacman" ;;
 | 
				
			||||||
 | 
					         debian|ubuntu) type="apt" ;;
 | 
				
			||||||
 | 
					         gentoo) type="emerge" ;;
 | 
				
			||||||
 | 
					         *)
 | 
				
			||||||
 | 
					            echo "Don't know how to manage packages on: $os" >&2
 | 
				
			||||||
 | 
					            exit 1
 | 
				
			||||||
 | 
					         ;;
 | 
				
			||||||
 | 
					   esac
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
set -- "$@" "$object_id"
 | 
					set -- "$@" "$__object_id"
 | 
				
			||||||
 | 
					cd "$__object/parameter"
 | 
				
			||||||
for property in $(ls .); do
 | 
					for property in $(ls .); do
 | 
				
			||||||
   if [ "$property" != "type" ]; then
 | 
					   if [ "$property" != "type" ]; then
 | 
				
			||||||
      set -- "$@" "--$property" "$(cat $property)"
 | 
					      set -- "$@" "--$property" "$(cat "$property")"
 | 
				
			||||||
   fi
 | 
					   fi
 | 
				
			||||||
done
 | 
					done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,2 +1,3 @@
 | 
				
			||||||
name
 | 
					name
 | 
				
			||||||
 | 
					version
 | 
				
			||||||
type
 | 
					type
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1 +1 @@
 | 
				
			||||||
ensure
 | 
					state
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue