From 721ed8542b746e43e37c00d42a8b6c61692dcbdb Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Wed, 14 Jul 2021 10:31:25 +0100 Subject: [PATCH 1/2] dev-cmd/bottle: fixup macOS symlink permissions. These can be changed on macOS but not on Linux so we need to make them consistent in both places for `all:` bottles to have consistent checksums. I investigated adding to `cleaner.rb` to fix these symlink permissions on installation but it seems it already happens by default when extracting so there's no need. --- Library/Homebrew/dev-cmd/bottle.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Library/Homebrew/dev-cmd/bottle.rb b/Library/Homebrew/dev-cmd/bottle.rb index f95f2ef2fd..c20a7bed3a 100644 --- a/Library/Homebrew/dev-cmd/bottle.rb +++ b/Library/Homebrew/dev-cmd/bottle.rb @@ -399,6 +399,8 @@ module Homebrew keg.find do |file| # Set the times for reproducible bottles. if file.symlink? + # Need to make symlink permissions consistent on macOS and Linux + system "chmod", "-h", "0777", file if OS.mac? File.lutime(tab.source_modified_time, tab.source_modified_time, file) else file.utime(tab.source_modified_time, tab.source_modified_time) From 82c57566904147393065d06ff30ecdb899470c6e Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Wed, 14 Jul 2021 11:45:03 +0100 Subject: [PATCH 2/2] dev-cmd/bottle: use native Ruby. Co-authored-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> --- Library/Homebrew/dev-cmd/bottle.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/dev-cmd/bottle.rb b/Library/Homebrew/dev-cmd/bottle.rb index c20a7bed3a..b803e5e6fa 100644 --- a/Library/Homebrew/dev-cmd/bottle.rb +++ b/Library/Homebrew/dev-cmd/bottle.rb @@ -400,7 +400,7 @@ module Homebrew # Set the times for reproducible bottles. if file.symlink? # Need to make symlink permissions consistent on macOS and Linux - system "chmod", "-h", "0777", file if OS.mac? + File.lchmod 0777, file if OS.mac? File.lutime(tab.source_modified_time, tab.source_modified_time, file) else file.utime(tab.source_modified_time, tab.source_modified_time)