@@ -51,7 +51,7 @@ def dispatch_uninstall_directives(stanza, expand_tilde=false)
51
51
executable , script_arguments = self . class . read_script_arguments ( directives ,
52
52
'uninstall' ,
53
53
{ :must_succeed => true } ,
54
- { :sudo => true , :print => true } ,
54
+ { :sudo => true , :print_stdout => true } ,
55
55
:early_script )
56
56
57
57
ohai "Running uninstall script #{ executable } "
@@ -65,7 +65,7 @@ def dispatch_uninstall_directives(stanza, expand_tilde=false)
65
65
Array ( directives [ :launchctl ] ) . each do |service |
66
66
ohai "Removing launchctl service #{ service } "
67
67
[ false , true ] . each do |with_sudo |
68
- xml_status = @command . run ( '/bin/launchctl' , :args => [ 'list' , '-x' , service ] , :sudo => with_sudo )
68
+ xml_status = @command . run ( '/bin/launchctl' , :args => [ 'list' , '-x' , service ] , :sudo => with_sudo ) . stdout
69
69
if %r{^<\? xml} . match ( xml_status )
70
70
@command . run ( '/bin/launchctl' , :args => [ 'unload' , '-w' , '--' , service ] , :sudo => with_sudo )
71
71
sleep 1
@@ -80,7 +80,7 @@ def dispatch_uninstall_directives(stanza, expand_tilde=false)
80
80
directives_set . select { |h | h . key? ( :quit ) } . each do |directives |
81
81
Array ( directives [ :quit ] ) . each do |id |
82
82
ohai "Quitting application ID #{ id } "
83
- num_running = @command . run! ( '/usr/bin/osascript' , :args => [ '-e' , %Q{tell application "System Events" to count processes whose bundle identifier is "#{ id } "} ] , :sudo => true ) . to_i
83
+ num_running = @command . run! ( '/usr/bin/osascript' , :args => [ '-e' , %Q{tell application "System Events" to count processes whose bundle identifier is "#{ id } "} ] , :sudo => true ) . stdout . to_i
84
84
if num_running > 0
85
85
@command . run! ( '/usr/bin/osascript' , :args => [ '-e' , %Q{tell application id "#{ id } " to quit} ] , :sudo => true )
86
86
sleep 3
@@ -94,7 +94,7 @@ def dispatch_uninstall_directives(stanza, expand_tilde=false)
94
94
raise CaskInvalidError . new ( @cask , "Each #{ stanza } :signal must have 2 elements." ) unless pair . length == 2
95
95
signal , id = pair
96
96
ohai "Signalling '#{ signal } ' to application ID '#{ id } '"
97
- pid_string = @command . run! ( '/usr/bin/osascript' , :args => [ '-e' , %Q{tell application "System Events" to get the unix id of every process whose bundle identifier is "#{ id } "} ] , :sudo => true )
97
+ pid_string = @command . run! ( '/usr/bin/osascript' , :args => [ '-e' , %Q{tell application "System Events" to get the unix id of every process whose bundle identifier is "#{ id } "} ] , :sudo => true ) . stdout
98
98
if pid_string . match ( %r{\A \d +(?:\s *,\s *\d +)*\Z } ) # sanity check
99
99
pids = pid_string . split ( %r{\s *,\s *} ) . map ( &:strip ) . map ( &:to_i )
100
100
if pids . length > 0
@@ -116,7 +116,7 @@ def dispatch_uninstall_directives(stanza, expand_tilde=false)
116
116
directives_set . select { |h | h . key? ( :kext ) } . each do |directives |
117
117
Array ( directives [ :kext ] ) . each do |kext |
118
118
ohai "Unloading kernel extension #{ kext } "
119
- is_loaded = @command . run! ( '/usr/sbin/kextstat' , :args => [ '-l' , '-b' , kext ] , :sudo => true )
119
+ is_loaded = @command . run! ( '/usr/sbin/kextstat' , :args => [ '-l' , '-b' , kext ] , :sudo => true ) . stdout
120
120
if is_loaded . length > 1
121
121
@command . run! ( '/sbin/kextunload' , :args => [ '-b' , '--' , kext ] , :sudo => true )
122
122
sleep 1
@@ -129,7 +129,7 @@ def dispatch_uninstall_directives(stanza, expand_tilde=false)
129
129
executable , script_arguments = self . class . read_script_arguments ( directives ,
130
130
'uninstall' ,
131
131
{ :must_succeed => true } ,
132
- { :sudo => true , :print => true } ,
132
+ { :sudo => true , :print_stdout => true } ,
133
133
:script )
134
134
raise CaskInvalidError . new ( @cask , "#{ stanza } :script without :executable." ) if executable . nil?
135
135
@command . run ( @cask . destination_path . join ( executable ) , script_arguments )
@@ -185,10 +185,10 @@ def dispatch_uninstall_directives(stanza, expand_tilde=false)
185
185
next unless directory . exist?
186
186
@command . run! ( '/bin/rm' , :args => [ '-f' , '--' , directory . join ( '.DS_Store' ) ] ,
187
187
:sudo => true ,
188
- :stderr => :silence )
188
+ :print_stderr => false )
189
189
@command . run ( '/bin/rmdir' , :args => [ '--' , directory ] ,
190
190
:sudo => true ,
191
- :stderr => :silence )
191
+ :print_stderr => false )
192
192
end
193
193
end
194
194
end
0 commit comments