diff options
| author | Markus Reiter | 2017-06-20 20:32:37 +0200 |
|---|---|---|
| committer | GitHub | 2017-06-20 20:32:37 +0200 |
| commit | 17b2694b1de33214e9bfd69a70638003cff2fa16 (patch) | |
| tree | 301fa0d8f42c92f28eb11c9a94329397f024ddad /Library | |
| parent | 96f8452e17f7a530b4cc823346b673f7626e6e95 (diff) | |
| parent | 19cf6dcb3f35ca475a5b96a56913aabb05e9918d (diff) | |
| download | brew-17b2694b1de33214e9bfd69a70638003cff2fa16.tar.bz2 | |
Merge pull request #2806 from reitermarkus/apfs
🔨 Fix sorting on APFS.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/cmd/switch.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/formula.rb | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/formula_pin_spec.rb | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/Library/Homebrew/cmd/switch.rb b/Library/Homebrew/cmd/switch.rb index a40b4d88e..8a378aed7 100644 --- a/Library/Homebrew/cmd/switch.rb +++ b/Library/Homebrew/cmd/switch.rb @@ -28,7 +28,7 @@ module Homebrew unless (rack/version).directory? onoe "#{name} does not have a version \"#{version}\" in the Cellar." - versions = rack.subdirs.map { |d| Keg.new(d).version } + versions = rack.subdirs.map { |d| Keg.new(d).version }.sort puts "Versions available: #{versions.join(", ")}" exit 3 diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index d64191b66..66993a348 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -602,7 +602,7 @@ class Formula # All currently installed prefix directories. # @private def installed_prefixes - rack.directory? ? rack.subdirs : [] + rack.directory? ? rack.subdirs.sort : [] end # All currently installed kegs. @@ -1182,7 +1182,7 @@ class Formula return false unless old_rack.directory? return false if old_rack.subdirs.empty? - tap == Tab.for_keg(old_rack.subdirs.first).tap + tap == Tab.for_keg(old_rack.subdirs.sort.first).tap end # @private diff --git a/Library/Homebrew/test/formula_pin_spec.rb b/Library/Homebrew/test/formula_pin_spec.rb index 909bfbc2b..ce952a957 100644 --- a/Library/Homebrew/test/formula_pin_spec.rb +++ b/Library/Homebrew/test/formula_pin_spec.rb @@ -9,7 +9,7 @@ describe FormulaPin do formula.rack.mkpath allow(formula).to receive(:installed_prefixes) do - formula.rack.directory? ? formula.rack.subdirs : [] + formula.rack.directory? ? formula.rack.subdirs.sort : [] end allow(formula).to receive(:installed_kegs) do |
