From 2144c35539318a8ec88ba3ebcca473a917eee71b Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Wed, 5 Apr 2017 09:00:11 +0100 Subject: [PATCH] keg_relocate: slim long lines. --- Library/Homebrew/keg_relocate.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/keg_relocate.rb b/Library/Homebrew/keg_relocate.rb index 4ec9136429..6044426ee4 100644 --- a/Library/Homebrew/keg_relocate.rb +++ b/Library/Homebrew/keg_relocate.rb @@ -16,7 +16,9 @@ class Keg link = file.readlink # Don't fix relative symlinks next unless link.absolute? - next unless link.to_s.start_with?(HOMEBREW_CELLAR.to_s) || link.to_s.start_with?(HOMEBREW_PREFIX.to_s) + link_starts_cellar = link.to_s.start_with?(HOMEBREW_CELLAR.to_s) + link_starts_prefix = link.to_s.start_with?(HOMEBREW_PREFIX.to_s) + next if !link_starts_cellar && !link_starts_prefix new_src = link.relative_path_from(file.parent) file.unlink FileUtils.ln_s(new_src, file)