puppetlabs/puppet — pull request #1224 by dickolsson (2012-10-16 11:12:52+00:00)
Title: Unpacker must force mv when extracting module to install dir

When the Unpacker tries to extract a module containing a broken symlink to its install dir the FileUtils::mv command fails for some reason. I'm not sure why, because moving a directly with broken symlinks is normally ok. But doing a force move fixes the problem.

It fails with the following error:

Error: No such file or directory - /etc/puppet/manifests/.tmp/librarian/cache/source/puppet/forge/3792e516e3ff92a0ef9f5e827f8e76eb/puppetlabs/apache/version/9eac01120a372609e0afa3b236d9ed2d/apache/spec/fixtures/modules/apache

In my case, it happens to be `librarian-puppet` that's executing `puppet module install`, which fails. The broken symlink is coming from the apache module, which tries to self reference itself in the `fixtures` folder. This in itself might be a bug in the `puppetlabs-apache` module. But still, I think Unpacker should be able to handle cases like this.

For reference, here's the broken symlink in the `puppetlabs-apache` module:
me@laptop:/tmp/puppetlabs-apache-0.4.0/spec/fixtures/modules# ls -l
lrwxrwxrwx 1 me me 50 Aug 24 23:31 apache -> /Users/hunner/Documents/work/git/puppetlabs-apache

I guess the broken symlink is coming from here: https://github.com/puppetlabs/puppetlabs-apache/blob/master/.fixtures.yml#L6

My environment:
* Ubuntu 12.04
* Ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
* Puppet: 3.0.0