Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix InstallPackage for prescribed versions #133

Merged
merged 2 commits into from
Sep 12, 2024

Conversation

ThomasBreuer
Copy link
Contributor

If an exact version number (one starting with =) is prescribed in InstallPackage, 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 is false.

This affects InstallPackageByName and InstallPackageByInfo. (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 return false 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 =.)

If an exact version number (one starting with `=`) is prescribed
in `InstallPackage`, the exactness was ignored up to now.
With the change, an available version with larger version number
is not regarded as matching the version condition in this case,
and the return value is `false`.

This affects `InstallPackageByName` and `InstallPackageByInfo`.
(The possibility to prescribe a version number in the latter
function is in fact not documented.)
Copy link

codecov bot commented Sep 12, 2024

Codecov Report

Attention: Patch coverage is 85.71429% with 3 lines in your changes missing coverage. Please review.

Project coverage is 86.42%. Comparing base (e4324af) to head (b147909).
Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
gap/distro.gi 66.66% 2 Missing ⚠️
gap/packageinfo.gi 91.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #133      +/-   ##
==========================================
- Coverage   86.44%   86.42%   -0.03%     
==========================================
  Files          22       22              
  Lines         996     1009      +13     
==========================================
+ Hits          861      872      +11     
- Misses        135      137       +2     
Files with missing lines Coverage Δ
gap/compile.gi 93.02% <100.00%> (-0.60%) ⬇️
gap/packageinfo.gi 91.78% <91.66%> (-0.87%) ⬇️
gap/distro.gi 81.72% <66.66%> (-0.15%) ⬇️

@mtorpey
Copy link
Collaborator

mtorpey commented Sep 12, 2024

This is good – I'd forgotten about this weirdness with the = sign, and this change makes things much more sensible.

Thanks also for fixing the tests I broke yesterday!

@mtorpey mtorpey merged commit bf160fa into gap-packages:master Sep 12, 2024
5 checks passed
@ThomasBreuer ThomasBreuer deleted the TB_prescribed_version branch September 12, 2024 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants