diff --git a/developer/bin/list_ids_in_pkg b/developer/bin/list_ids_in_pkg index a7a2fff687..5da3a7fee7 100755 --- a/developer/bin/list_ids_in_pkg +++ b/developer/bin/list_ids_in_pkg @@ -49,7 +49,7 @@ mark_up_sources () { _list_ids_in_pkg () { tmpdir=`/usr/bin/mktemp -d -t list_ids_in_pkg` - trap "/bin/rm -rf '$tmpdir'" EXIT + trap "/bin/rm -rf -- '$tmpdir'" EXIT /usr/sbin/pkgutil --expand "$1" "$tmpdir/unpack" diff --git a/developer/bin/production_brew_cask b/developer/bin/production_brew_cask index 318f280389..15fbb76bac 100755 --- a/developer/bin/production_brew_cask +++ b/developer/bin/production_brew_cask @@ -63,11 +63,11 @@ not_inside_homebrew () { remove_dev_links () { local tap_dir="$1" - /bin/rm rubylib Casks + /bin/rm -- rubylib Casks /bin/mv -- production_rubylib rubylib /bin/mv -- production_Casks Casks cd "$tap_dir" - /bin/rm lib Casks + /bin/rm -- lib Casks /bin/mv -- production_lib lib /bin/mv -- production_Casks Casks printf "brew-cask is now in production mode\n" diff --git a/lib/cask/artifact/pkg.rb b/lib/cask/artifact/pkg.rb index 447c4ab649..44c5fb8a99 100644 --- a/lib/cask/artifact/pkg.rb +++ b/lib/cask/artifact/pkg.rb @@ -118,7 +118,7 @@ class Cask::Artifact::Pkg < Cask::Artifact::Base if uninstall_options.key? :files uninstall_options[:files].each do |file| ohai "Removing file #{file}" - @command.run!('/bin/rm', :args => ['-rf', file], :sudo => true) + @command.run!('/bin/rm', :args => ['-rf', '--', file], :sudo => true) end end end diff --git a/lib/cask/pkg.rb b/lib/cask/pkg.rb index 9944e0559e..366b8e9960 100644 --- a/lib/cask/pkg.rb +++ b/lib/cask/pkg.rb @@ -15,7 +15,7 @@ class Cask::Pkg def uninstall odebug "Deleting pkg files" list('files').each_slice(500) do |file_slice| - @command.run('/bin/rm', :args => file_slice.unshift('-f'), :sudo => true) + @command.run('/bin/rm', :args => file_slice.unshift('-f', '--'), :sudo => true) end odebug "Deleting pkg directories" _deepest_path_first(list('dirs')).each do |dir| @@ -80,14 +80,14 @@ class Cask::Pkg def _clean_broken_symlinks(dir) dir.children.each do |child| if _broken_symlink?(child) - @command.run!('/bin/rm', :args => [child], :sudo => true) + @command.run!('/bin/rm', :args => ['--', child], :sudo => true) end end end def _clean_ds_store(dir) ds_store = dir.join('.DS_Store') - @command.run!('/bin/rm', :args => [ds_store], :sudo => true) if ds_store.exist? + @command.run!('/bin/rm', :args => ['--', ds_store], :sudo => true) if ds_store.exist? end def _broken_symlink?(path)