HomePhorge

Monkey patch FileUtils.mv in Ruby 1.8.5
1342558a01d7Unpublished

Unpublished Commit · Learn More

Repository Importing: This repository is still importing.

Description

Monkey patch FileUtils.mv in Ruby 1.8.5

The FileUtils.mv method in Ruby 1.8.5 can't mv directories across
devices. File.rename causes "Invalid cross-device link" errors, which
is rescued, but in Ruby 1.8.5 it tries to recover with a copy and
unlink, but the unlink causes the error "Is a directory". In newer
Rubies remove_entry is used, so the implementation in this patch is
what's used in Ruby 1.8.7 and Ruby 1.9

This was an issue in installing modules using puppet module install
since the module is extracted to a temporary directory and then moved to
the modulepath.

Details

Provenance
Matt Robinson <matt@puppetlabs.com>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPU2d51b642fcd1: Merge pull request #602 from cprice-puppet/bug/2.7.x/13439-spec-api…
Branches
Unknown
Tags
Unknown

Event Timeline

Matt Robinson <matt@puppetlabs.com> committed rPU1342558a01d7: Monkey patch FileUtils.mv in Ruby 1.8.5 (authored by Matt Robinson <matt@puppetlabs.com>).Mar 29 2012, 7:56 PM