Merge pull request #8630 from dtrodrigues/bottle-lutime

bottle: use File.lutime instead of system call
This commit is contained in:
Dustin Rodrigues 2020-09-08 09:51:33 -04:00 committed by GitHub
commit 17d92a2d81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -278,10 +278,7 @@ module Homebrew
keg.find do |file| keg.find do |file|
if file.symlink? if file.symlink?
# Ruby does not support `File.lutime` yet. File.lutime(tab.source_modified_time, tab.source_modified_time, file)
# Shellout using `touch` to change modified time of symlink itself.
system "/usr/bin/touch", "-h",
"-t", tab.source_modified_time.strftime("%Y%m%d%H%M.%S"), file
else else
file.utime(tab.source_modified_time, tab.source_modified_time) file.utime(tab.source_modified_time, tab.source_modified_time)
end end