juliandunn/oracle-instantclient — pull request #2 by ftclausen (2014-02-28 04:32:07+00:00)
Title: Update alternatives only after package installation.

Hello Julian,

I noticed, that on a clean box, the sqlplus recipe was failing by trying to set the alternatives prior to sqlplus package installation. What *I think* was happening is that it would run the Ruby library code at recipe compile time instead of recipe execution time. This meant that the binaries update-alternatives uses are not present.

This PR is an attempt at fixing this situation by

* Removing the Ruby library
* Create a ruby_block containing the update alternatives code (that used to be in the library)
* Call this ruby block once the sqlplus RPM has been installed

I modelled this approach on what the Java cookbook does. Perhaps a cleaner way is to figure out how a ruby_block can call a Chef cookbook library. That way the recipe code can be kept tidier however it is still pretty short so I figure it was OK in this instance.

Thanks,

Fred.