Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DSL remove support for old form uninstall :files #7367

Merged
merged 1 commit into from
Nov 16, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions lib/cask/artifact/uninstall_base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,7 @@ def dispatch_uninstall_directives(stanza, expand_tilde=false)
ohai "Running #{stanza} process for #{@cask}; your password may be necessary"

directives_set.each do |directives|
# todo remove backward-compatible :files
unknown_keys = directives.keys - [:early_script, :launchctl, :quit, :signal, :kext, :script, :pkgutil, :files, :delete, :trash, :rmdir]
unknown_keys = directives.keys - [:early_script, :launchctl, :quit, :signal, :kext, :script, :pkgutil, :delete, :trash, :rmdir]
unless unknown_keys.empty?
opoo %Q{Unknown arguments to #{stanza} -- #{unknown_keys.inspect}. Running "brew update && brew upgrade brew-cask && brew cleanup && brew cask cleanup" will likely fix it.}
end
Expand Down Expand Up @@ -308,17 +307,6 @@ def dispatch_uninstall_directives(stanza, expand_tilde=false)
end
end

# todo: remove support for deprecated :files both here and elsewhere
directives_set.select{ |h| h.key?(:files) }.each do |directives|
Array(directives[:files]).flatten.each_slice(PATH_ARG_SLICE_SIZE) do |path_slice|
ohai "Removing files: #{path_slice.utf8_inspect}"
path_slice = self.class.expand_path_strings(path_slice) if expand_tilde
path_slice = self.class.remove_relative_path_strings(:delete, path_slice) # :delete for messages
path_slice = self.class.remove_undeletable_path_strings(:delete, path_slice)
@command.run!('/bin/rm', :args => path_slice.unshift('-rf', '--'), :sudo => true)
end
end

directives_set.select{ |h| h.key?(:rmdir) }.each do |directives|
Array(directives[:rmdir]).flatten.each do |directory|
directory = self.class.expand_path_strings([directory]).first if expand_tilde
Expand Down