gap-packages / PackageManager

Basic package manager for GAP
https://gap-packages.github.io/PackageManager/
Other
12 stars 8 forks source link

What's the difference between InstallPackage and UpdatePackage, exactly? #52

Open fingolfin opened 4 years ago

fingolfin commented 4 years ago

One (accidental?) difference is that in the manual, the first argument is once called string and once name ;-).

I think the manual should spell this out. I didn't look at the code on purpose, and also didn't try to figure it out from the manual (I feel the text there doesn't allow me to decide this conclusively anyway); but my guess based on a cursive reading and the names would be that for packages installed from archive, UpdatePackage is basically doing the same as InstallPackage, except it removes any older version(s) after installing the latest. Is that right?

mtorpey commented 2 months ago

I think there's no good reason to have both. Install offers to update if the package already exists, and Update offers to install if it doesn't. The two functions call each other in these edge cases, but this isn't an ideal design. The only difference is interactivity and defaults.

Probably some broader refactoring would include making these two functions synonyms.