puppetlabs/puppet — pull request #1858 by MosesMendoza (2013-08-28 22:09:56+00:00)
Title: (22329) Only delete puppet files in the preflight

Previously, the OSX preflight removed the contents of the 'hiera' directory
which also happens to be where the puppet.pkg places the contents of
hiera_puppet. The fix is pretty easy - from the hiera dir, only remove the
files that exist in the 'puppet' project, no others, e.g. not those from the
hiera.pkg. This commit accomplishes this by only deleting files from 'hiera',
not the directories. It's a bit crufty, but its better than clobbering the
wrong files. With the puppet directory, we can still just remove it. This
commit also fixes some obvious oddities with the rm calls. Previously we just
called rm -Rf indiscriminately. This PR ensures we're calling rm -f on files
and rm -Rf on directories.

Signed-off-by: Moses Mendoza