aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMarkus Reiter2017-05-23 18:46:48 +0200
committerGitHub2017-05-23 18:46:48 +0200
commitfdd9972aa7c6267fad8c5648a203d0e24a6fdf0a (patch)
treeaa18fa216239f81ccd9a7ababd7ca31e298c985c /Library
parentb7cfd5e30dbcf90a2e4c8c6e02b640503cf217a6 (diff)
parent38b5e4254ba037fca975965603d6227ab99690db (diff)
downloadbrew-fdd9972aa7c6267fad8c5648a203d0e24a6fdf0a.tar.bz2
Merge pull request #2670 from reitermarkus/fix-uninstall-order
Fix `uninstall` order.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cask/lib/hbc/artifact.rb12
-rw-r--r--Library/Homebrew/cask/lib/hbc/installer.rb4
2 files changed, 9 insertions, 7 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/artifact.rb b/Library/Homebrew/cask/lib/hbc/artifact.rb
index e5eb54c36..074d15017 100644
--- a/Library/Homebrew/cask/lib/hbc/artifact.rb
+++ b/Library/Homebrew/cask/lib/hbc/artifact.rb
@@ -25,10 +25,17 @@ require "hbc/artifact/zap"
module Hbc
module Artifact
- # NOTE: order is important here, since we want to extract nested containers
- # before we handle any other artifacts
+ # NOTE: Order is important here!
+ #
+ # The `uninstall` stanza should be run first, as it may
+ # depend on other artifacts still being installed.
+ #
+ # We want to extract nested containers before we
+ # handle any other artifacts.
+ #
TYPES = [
PreflightBlock,
+ Uninstall,
NestedContainer,
Installer,
App,
@@ -49,7 +56,6 @@ module Hbc
VstPlugin,
Vst3Plugin,
ScreenSaver,
- Uninstall,
PostflightBlock,
Zap,
].freeze
diff --git a/Library/Homebrew/cask/lib/hbc/installer.rb b/Library/Homebrew/cask/lib/hbc/installer.rb
index a783f764b..7da9731e5 100644
--- a/Library/Homebrew/cask/lib/hbc/installer.rb
+++ b/Library/Homebrew/cask/lib/hbc/installer.rb
@@ -358,10 +358,6 @@ module Hbc
odebug "Un-installing artifacts"
artifacts = Artifact.for_cask(@cask, command: @command, verbose: verbose?, force: force?)
- # Make sure the `uninstall` stanza is run first, as it
- # may depend on other artifacts still being installed.
- artifacts = artifacts.sort_by { |a| a.is_a?(Artifact::Uninstall) ? -1 : 1 }
-
odebug "#{artifacts.length} artifact/s defined", artifacts
artifacts.each do |artifact|