RiotGames/berkshelf — pull request #91 by bluepojo (2012-07-19 08:41:23+00:00)
Title: Skip broken symlinks encountered in hardlink traversal.

This is a possible solution to encountering broken symlinks during the hardlink traversal.

This fixes the issue where emacs (among other editors) uses broken symlinks to mark files as open:

```
.#filename -> user@hostname
```

When using `path` to a cookbook currently under development with emacs, encountering such files is common.

When the current implementation of `#ln_r` encounters these files, it tries to make a hardlink to the dereferenced link and cannot find the file named `user@hostname`, raising an `Errno::ENOENT`. Berkshelf is not in a position to catch the error as the traversal is stopped prematurely when potentially not all files are linked. We would have to do the traversal and not do a recursive `ln` if we wanted Berkshelf to handle this error.

I'm not 100% sure about printing a warning on fileutils.rb:67, but I figured it would be wise to throw some sort of notification in case someone had a symlink they wanted dereferenced and hardlinked but was actually a broken link.

NOTE: It's late and I have an issue getting the cukes to run. Do not merge until I confirm that I am green on cukes or you run the features yourself to confirm on your end.