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.
This commit is contained in:
Mike McQuaid 2021-07-14 10:31:25 +01:00
parent cb84000e72
commit 721ed8542b
No known key found for this signature in database
GPG Key ID: 3338A31AFDB1D829

View File

@ -399,6 +399,8 @@ module Homebrew
keg.find do |file| keg.find do |file|
# Set the times for reproducible bottles. # Set the times for reproducible bottles.
if file.symlink? 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) File.lutime(tab.source_modified_time, tab.source_modified_time, file)
else else
file.utime(tab.source_modified_time, tab.source_modified_time) file.utime(tab.source_modified_time, tab.source_modified_time)