-
Notifications
You must be signed in to change notification settings - Fork 365
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -202,9 +202,25 @@ let upgrade_t | |
else OpamPackage.packages_of_names t.installed requested | ||
in | ||
let latest = | ||
OpamPackage.Name.Set.fold (fun name acc -> | ||
OpamPackage.Set.add (OpamPackage.max_version t.packages name) acc) | ||
(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 | ||
let latest = | ||
OpamPackage.Set.fold (fun pkg latest -> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this variable named |
||
if OpamPackage.compare latest pkg < 0 then | ||
let opam = OpamPackage.Map.find pkg t.opams in | ||
let avoid_version = | ||
List.exists (function | ||
| Pkgflag_AvoidVersion | Pkgflag_Deprecated -> true | ||
| _ -> false) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
(OpamFile.OPAM.flags opam) | ||
in | ||
if avoid_version then latest else pkg | ||
else latest) | ||
pkgs pkg | ||
in | ||
OpamPackage.Set.add latest acc) | ||
to_check | ||
OpamPackage.Set.empty in | ||
let notuptodate = latest -- to_check in | ||
if OpamPackage.Set.is_empty notuptodate then | ||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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