orlyatomics/orly — pull request #76 by cmaloney (2014-05-22 04:56:44+00:00)
Title: Fixes #70

An alternative method to #73.

First it pulls the pre install callback per package to a point where there's no chance of the package manager getting it into a consistent state (Before it was possible some packages would get loaded, then the manager would throw an exception loading a package, leaving the callbacks in an unrecoverable state). Now the package manager finishes all it's work before calling the callback at all.

Next the callback gains an additional paramter which indicates whether or not the package is a new version (Which means upgraded or newly installed packages). This makes it so whatever we're calling back to can handle upgrades of packages differently than reinstalls.

The last patch disables reinstalling the same version of a package. If the same package is built twice with the same version, it will generate new index UUIDs which don't match. If it's reinstalled twice with the same build, it will have the same index UUIDs. Which of these cases we're handling is hard to determine, so we just disable it altogether.