Workound lack of pipeline's integrity guarantee.
This commit is contained in:
		
					parent
					
						
							
								cd5050cc91
							
						
					
				
			
			
				commit
				
					
						deafcc60e8
					
				
			
		
					 3 changed files with 11 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -34,7 +34,8 @@ fi
 | 
			
		|||
case "$state_should" in
 | 
			
		||||
   absent)
 | 
			
		||||
      # remove lines starting with key
 | 
			
		||||
      echo "sed '/^$key\($delimiter\+\)/d' \"$file\" | tee \"$file\" > /dev/null"
 | 
			
		||||
      echo "sed '/^$key\($delimiter\+\)/d' \"$file\" > \"$file.cdist-tmp\""
 | 
			
		||||
      echo "mv \"$file.cdist-tmp\" \"$file\""
 | 
			
		||||
   ;;
 | 
			
		||||
   present)
 | 
			
		||||
      case "$state_is" in
 | 
			
		||||
| 
						 | 
				
			
			@ -44,7 +45,8 @@ case "$state_should" in
 | 
			
		|||
         ;;
 | 
			
		||||
         wrongvalue)
 | 
			
		||||
            # change exisiting value
 | 
			
		||||
            echo "sed \"s|^$key\($delimiter\+\).*|$key\1$value|\" \"$file\" | tee \"$file\" > /dev/null"
 | 
			
		||||
            echo "sed \"s|^$key\($delimiter\+\).*|$key\1$value|\" \"$file\" > \"$file.cdist-tmp\""
 | 
			
		||||
            echo "mv \"$file.cdist-tmp\" \"$file\""
 | 
			
		||||
         ;;
 | 
			
		||||
         *)
 | 
			
		||||
            echo "Unknown explorer state: $state_is" >&2
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -32,7 +32,9 @@ DONE
 | 
			
		|||
      removed)
 | 
			
		||||
         cat << DONE
 | 
			
		||||
su - $user -c "rm -Rf \"\\\$HOME/.rvm\";
 | 
			
		||||
sed '/rvm\/scripts\/rvm/d' \"\\\$HOME/.bashrc\" | tee \"\\\$HOME/.bashrc\" > /dev/null"
 | 
			
		||||
sed '/rvm\/scripts\/rvm/d' \"\\\$HOME/.bashrc\" > \"\\\$HOME/.bashrc.cdist-tmp\"
 | 
			
		||||
mv \"\\\$HOME/.bashrc.cdist-tmp\" \"\\\$HOME/.bashrc\""
 | 
			
		||||
 | 
			
		||||
DONE
 | 
			
		||||
      ;;
 | 
			
		||||
   esac
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -32,7 +32,8 @@ case "$state_should" in
 | 
			
		|||
    present)
 | 
			
		||||
        case "$os" in
 | 
			
		||||
            archlinux)
 | 
			
		||||
                echo "sed 's/^\\(DAEMONS=.*\\))/\\1 $name)/' /etc/rc.conf | tee /etc/rc.conf > /dev/null"
 | 
			
		||||
                echo "sed 's/^\\(DAEMONS=.*\\))/\\1 $name)/' /etc/rc.conf > /etc/rc.conf.cdist-tmp"
 | 
			
		||||
                echo "mv /etc/rc.conf.cdist-tmp /etc/rc.conf"
 | 
			
		||||
            ;;
 | 
			
		||||
            debian|ubuntu)
 | 
			
		||||
                echo "update-rc.d \"$name\" defaults >/dev/null"
 | 
			
		||||
| 
						 | 
				
			
			@ -66,7 +67,8 @@ case "$state_should" in
 | 
			
		|||
            archlinux)
 | 
			
		||||
                # Replace a) at the beginning b) in the middle c) end d) only
 | 
			
		||||
                # Support @name as well...makes it more ugly, but well...
 | 
			
		||||
                echo "sed /etc/rc.conf -e 's/^\\(DAEMONS=(\\)@\\{0,1\\}$name /\\1/' -e 's/^\\(DAEMONS=(.* \\)@\\{0,1\\}$name \\(.*\\)/\\1\\2/' -e 's/^\\(DAEMONS=(.*\\) @\\{0,1\\}$name)/\\1)/' -e 's/^\\(DAEMONS=(\\)@\\{0,1\\}$name)/\\1)/' | tee /etc/rc.conf > /dev/null"
 | 
			
		||||
                echo "sed /etc/rc.conf -e 's/^\\(DAEMONS=(\\)@\\{0,1\\}$name /\\1/' -e 's/^\\(DAEMONS=(.* \\)@\\{0,1\\}$name \\(.*\\)/\\1\\2/' -e 's/^\\(DAEMONS=(.*\\) @\\{0,1\\}$name)/\\1)/' -e 's/^\\(DAEMONS=(\\)@\\{0,1\\}$name)/\\1)/' > /etc/rc.conf.cdist-tmp"
 | 
			
		||||
                echo "mv /etc/rc.conf.cdist-tmp /etc/rc.conf"
 | 
			
		||||
            ;;
 | 
			
		||||
            debian|ubuntu)
 | 
			
		||||
                echo update-rc.d -f \"$name\" remove
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue