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

opam upgrade: Do not show the not-up-to-date message with packages tagged with avoid-version #6273

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kit-ty-kate
Copy link
Member

Fixes #6271

Copy link
Collaborator

@rjbou rjbou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I needs a test too.

let avoid_version =
List.exists (function
| Pkgflag_AvoidVersion | Pkgflag_Deprecated -> true
| _ -> false)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should expand the default case, like that if we add another flag and this part is concerned there is an highlight.

let name = OpamPackage.name pkg in
let pkgs = OpamPackage.packages_of_name t.packages name in
let latest =
OpamPackage.Set.fold (fun pkg latest ->
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this variable named pkg and the one defined 4 lines above are not the "same package" but have the same name, this can be misleading when reading the code.

(OpamPackage.names_of_packages to_check)
OpamPackage.Set.fold (fun pkg acc ->
let name = OpamPackage.name pkg in
let pkgs = OpamPackage.packages_of_name t.packages name in
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if it worth working on the set of version instead of package one.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it simplifies the code greatly. Otherwise we would need to have an intermediate map of set and update it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

avoid-version packages should be ignored when opam upgrade refuses to upgrade
2 participants