The following algorithm sorts two sets of packages based on the name and version numbers of each package. Given two sets of packages OldPackageSet and NewPackageSet, the packages are sorted as follows:
This is a list of packages from NewPackageSet that will replace packages in OldPackageSet.
This is a list of packages from NewPackageSet that do not exist in OldPackageSet.
This is a list of packages from OldPackageSet that have no equivilent in NewPackageSet.
This is a list of packages from OldPackageSet that will be replaced by packages in NewPackageSet.