hw-cookbooks/omnibus_updater — pull request #66 by joshk0 (2014-09-24 05:37:02+00:00)
Title: Install the Omnibus RPM twice

Certain very old versions of Chef (up until 10.22 or perhaps later)
unconditionally deleted the symlinks to the Chef tools in /usr/bin on
removal. Unfortunately, upgrade involves removal, so upgrading Chef
would trash the symlinks permanently as post-removal scripts are only
run AFTER the post-install script of the new package.

The easiest and most painless workaround to this, to allow people to use
omnibus_updater to upgrade older Chef installs, is simply to run the
Chef install twice. The first run trashes the symlinks going from (bad
version) -> (hopefully fixed new version.) The second run does a no-op
install from (new version) -> (new version). With no cursed version
being involved, the symlinks are deployed and then not deleted by the
post-removal script.