Replacing Packages

The following algorithm is used to determine whether a package should be replaced or not. The algorithm assumes that the package and its replacement have the name. The flavor and package type of the package can be different. It also checks two -force and -loose. The following are the tests are conducted on the packages. These need to be run in order:

  1. Replace the package if -force is true and the flavors and package types are the same.

  2. Don't Replace the package if it is newer than its replacement.

  3. Replace the package if the replacement is newer and the flavors and package types are the same.

  4. Replace the package if the versions and flavors are the same and the package type for the package is pgm_static. Also the flavor cannot be set to noflavor

  5. Replace the package if the -loose flag is true and the package types for the package is pgm or pgm_static. The -loose flag is only valid if the package belongs to a version 2.x bundle or is unaffiliated.

  6. Add the replacement to the installation if its package type is rtl or dev and the flavors for the package and the replacement are different. Packages of this type can be collocated without file conflicts.

  7. Don't Replace for any other cases.