diff options
| author | Mike McQuaid | 2016-08-17 11:07:17 +0100 |
|---|---|---|
| committer | GitHub | 2016-08-17 11:07:17 +0100 |
| commit | cf71e30180d44219836ef129d5e5f00325210dfb (patch) | |
| tree | 220d3832242f35bb9944562b020261d2f4314695 /Library/Homebrew/extend/fileutils.rb | |
| parent | 5bbc3c21f2235c37be2c01b6d133abcbe2070fb3 (diff) | |
| parent | ed5e2ea3003acc858e0886cb1c4a944f44ba598e (diff) | |
| download | brew-cf71e30180d44219836ef129d5e5f00325210dfb.tar.bz2 | |
Merge pull request #724 from MikeMcQuaid/assume-ruby-two
Assume Ruby 2
Diffstat (limited to 'Library/Homebrew/extend/fileutils.rb')
| -rw-r--r-- | Library/Homebrew/extend/fileutils.rb | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/Library/Homebrew/extend/fileutils.rb b/Library/Homebrew/extend/fileutils.rb index b54a5cadf..86abcee85 100644 --- a/Library/Homebrew/extend/fileutils.rb +++ b/Library/Homebrew/extend/fileutils.rb @@ -98,54 +98,6 @@ module FileUtils end module_function :mkdir - # The #copy_metadata method in all current versions of Ruby has a - # bad bug which causes copying symlinks across filesystems to fail; - # see #14710. - # This was resolved in Ruby HEAD after the release of 1.9.3p194, but - # never backported into the 1.9.3 branch. Fixed in 2.0.0. - # The monkey-patched method here is copied directly from upstream fix. - if RUBY_VERSION < "2.0.0" - # @private - class Entry_ - alias_method :old_copy_metadata, :copy_metadata - def copy_metadata(path) - st = lstat - unless st.symlink? - File.utime st.atime, st.mtime, path - end - begin - if st.symlink? - begin - File.lchown st.uid, st.gid, path - rescue NotImplementedError - end - else - File.chown st.uid, st.gid, path - end - rescue Errno::EPERM - # clear setuid/setgid - if st.symlink? - begin - File.lchmod st.mode & 01777, path - rescue NotImplementedError - end - else - File.chmod st.mode & 01777, path - end - else - if st.symlink? - begin - File.lchmod st.mode, path - rescue NotImplementedError - end - else - File.chmod st.mode, path - end - end - end - end - end - # Run `scons` using a Homebrew-installed version rather than whatever is in the `PATH`. def scons(*args) system Formulary.factory("scons").opt_bin/"scons", *args @@ -187,14 +139,3 @@ module FileUtils ENV.update(removed) end end - -# Shim File.write for Ruby 1.8.7, where it's absent -unless File.respond_to?(:write) - class File - def self.write(filename, contents) - File.open(filename, "w") do |file| - file.write contents - end - end - end -end |
