Add rake dependency.
Make sure packages are preserved based on their full version.

Until now, a package was removed (even with preserve_versions set to true) when its version component and name was the same as another package.
Instead, it should compare the full versions of the package (i.e. epoch, version, and iteration must be the same, not only the version).

Also added tests for the changes.