diff options
| author | Mike McQuaid | 2016-08-16 17:00:38 +0100 |
|---|---|---|
| committer | Mike McQuaid | 2016-08-17 09:19:56 +0100 |
| commit | f32251d461b7962436593fe7c99d8b01bc277001 (patch) | |
| tree | c5e44f64265a472642ceb095698c53b19d85e84b /Library/Homebrew/extend/fileutils.rb | |
| parent | 7dddc4df9f4930a05ef98365fb61b710201a1cd2 (diff) | |
| download | brew-f32251d461b7962436593fe7c99d8b01bc277001.tar.bz2 | |
extend/fileutils: 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 |
