fix InstallPackage
for prescribed versions
#133
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If an exact version number (one starting with
=
) is prescribed inInstallPackage
, the exactness was ignored up to now. With this change, an available package version with larger version number is not regarded as matching the version condition in this case, and the return value isfalse
.This affects
InstallPackageByName
andInstallPackageByInfo
. (The possibility to prescribe a version number in the latter function is in fact not documented.)The problem had been observed already in issue #114. Its discussion makes clear that (currently) PackageManager cannot access arbitrary older versions of GAP packages. My understanding is that
InstallPackage
must returnfalse
if an exact version number is requested and if if this version cannot be made available.Should the documentation be made clearer in this respect?
Sorry for the inconveniences, in particular for not reacting earlier.
The reason for the bug was a wrong usage of GAP's
CompareVersionNumbers
.(All code involving this function could be simplified if this function would deal with the meaning of version numbers starting with
=
.)