From af92fe2f1765a38851bdc14cc809c4a961b23d37 Mon Sep 17 00:00:00 2001 From: Michka Popoff Date: Sat, 1 Dec 2018 10:06:12 +0100 Subject: [PATCH] bottle: Fix bottling for Linux When there is no previous linux bottle, and the bottle block looks like this: bottle do sha256 "5cbcce4556b41ece91f01778068f481514bc3a0d5447ddbff048797236cc9b29" => :mojave sha256 "15748ef1ffefa088f7c958e6935c6eec794781858e6190196e18e94ab768adc2" => :high_sierra sha256 "49eb0e5d27b8868b2dba20efbde3ef75becc0cbf5ea230c00e5745e2df697cb6" => :sierra end then the bottling fails with: Error: --keep-old was passed but there are changes in: cellar: old: "/home/linuxbrew/.linuxbrew/Cellar", new: :any_skip_relocation ==> FAILED This change allows to run the bottling step for these cases. --- Library/Homebrew/dev-cmd/bottle.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/dev-cmd/bottle.rb b/Library/Homebrew/dev-cmd/bottle.rb index e613467561..be4dcf7278 100644 --- a/Library/Homebrew/dev-cmd/bottle.rb +++ b/Library/Homebrew/dev-cmd/bottle.rb @@ -390,7 +390,10 @@ module Homebrew mismatches = [:root_url, :prefix, :cellar, :rebuild].reject do |key| old_spec.send(key) == bottle.send(key) end - mismatches.delete(:cellar) if old_spec.cellar == :any && bottle.cellar == :any_skip_relocation + if old_spec.cellar == :any && bottle.cellar == :any_skip_relocation + mismatches.delete(:cellar) + bottle.cellar :any + end unless mismatches.empty? bottle_path.unlink if bottle_path.exist?