File tree 5 files changed +45
-6
lines changed
5 files changed +45
-6
lines changed Original file line number Diff line number Diff line change 29
29
## Install
30
30
* Do not keep the build directory of the pinned packages [ #6436 @kit-ty-kate ]
31
31
* [ BUG] Fix ` opam install <local_dir> ` not updating and storing pinned packages' metadata [ #6209 @kit-ty-kate - fix #5567 ]
32
+ * [ BUG] Fix ` opam install --deps-only/--show-action <local_dir> ` not updating (without storing) pinned packages' metadata [ #6209 @kit-ty-kate - fix #5567 ]
32
33
33
34
## Build (package)
34
35
* Patches are now applied using the ` patch ` OCaml library instead of GNU Patch [ #5892 @kit-ty-kate - fix #6019 #6052 ]
@@ -251,6 +252,7 @@ users)
251
252
* ` OpamArg.InvalidCLI ` : export exception [ #6150 @rjbou ]
252
253
* ` OpamArg ` : export ` require_checksums ` and ` no_checksums ` , that are shared with ` build_options ` [ #5563 @rjbou ]
253
254
* ` OpamArg.hash_kinds ` : was added [ #5960 @kit-ty-kate ]
255
+ * ` OpamAuxCommands.{simulate_autopin,autopin ~simulate:true} ` : now updates the ` reinstall ` field of the returned ` switch_state ` if necessary [ #6209 @kit-ty-kate ]
254
256
* ` OpamRepositoryCommand.switch_repos ` : expose the function [ #5014 @kit-ty-kate ]
255
257
* ` OpamLockCommand.lock_opam ` : add ` ~keep_local ` argument to add local pins to pin-depends (and not resolve them) [ #6411 @rjbou ]
256
258
* ` OpamLockCommand.lock_opam ` : make the ` ?only_direct ` argument non-optional [ #6411 @kit-ty-kate ]
Original file line number Diff line number Diff line change @@ -401,6 +401,29 @@ let simulate_local_pinnings ?quiet ?(for_view=false) st to_pin =
401
401
st.switch_global st.switch st.switch_config ~pinned
402
402
~opams: local_opams)
403
403
);
404
+ reinstall = lazy (
405
+ let open OpamPackage.Set.Op in
406
+ let installed_pinned = st.pinned %% st.installed in
407
+ OpamPackage.Set. fold (fun pinned_pkg reinstall ->
408
+ match
409
+ OpamPackage.Set. find_opt
410
+ (fun pkg ->
411
+ OpamPackage.Name. equal
412
+ (OpamPackage. name pinned_pkg)
413
+ (OpamPackage. name pkg))
414
+ local_packages
415
+ with
416
+ | None -> reinstall
417
+ | Some local_pkg ->
418
+ let old_opam = OpamPackage.Map. find pinned_pkg st.installed_opams in
419
+ let new_opam = OpamPackage.Map. find local_pkg local_opams in
420
+ if OpamFile.OPAM. effectively_equal old_opam new_opam then
421
+ reinstall
422
+ else
423
+ OpamPackage.Set. add local_pkg
424
+ (OpamPackage.Set. remove pinned_pkg reinstall))
425
+ installed_pinned (Lazy. force st.reinstall)
426
+ );
404
427
pinned;
405
428
} in
406
429
st, local_packages
Original file line number Diff line number Diff line change @@ -2215,9 +2215,6 @@ let install_t t ?ask ?(ignore_conflicts=false) ?(depext_only=false)
2215
2215
in
2216
2216
let pkg_reinstall =
2217
2217
if assume_built then OpamPackage.Set. of_list pkg_skip
2218
- else if deps_only then OpamPackage.Set. empty
2219
- (* NOTE: As we only install dependency packages, there are no intersections
2220
- between t.reinstall and pkg_skip *)
2221
2218
else Lazy. force t.reinstall %% OpamPackage.Set. of_list pkg_skip
2222
2219
in
2223
2220
(* Add the packages to the list of package roots and display a
Original file line number Diff line number Diff line change @@ -1131,6 +1131,19 @@ depends: "dependency" {= "2"}
1131
1131
### opam install --deps-only ./pin-change
1132
1132
[NOTE] Ignoring uncommitted changes in ${BASEDIR}/pin-change (`--working-dir' not specified or specified with no argument).
1133
1133
[pin-change.dev] synchronised (no changes)
1134
+ The following actions will be performed:
1135
+ === recompile 1 package
1136
+ - recompile pin-change dev (pinned) [uses dependency]
1137
+ === upgrade 1 package
1138
+ - upgrade dependency 1 to 2 [required by pin-change]
1139
+
1140
+ <><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
1141
+ -> removed dependency.1
1142
+ -> installed dependency.2
1143
+ -> retrieved pin-change.dev (no changes)
1144
+ -> removed pin-change.dev
1145
+ -> installed pin-change.dev
1146
+ Done.
1134
1147
### opam remove pin-change
1135
1148
The following actions will be performed:
1136
1149
=== remove 1 package
@@ -1147,10 +1160,10 @@ depends: "dependency" {= "3"}
1147
1160
[pin-change.dev] synchronised (no changes)
1148
1161
The following actions will be performed:
1149
1162
=== upgrade 1 package
1150
- - upgrade dependency 1 to 3 [required by pin-change]
1163
+ - upgrade dependency 2 to 3 [required by pin-change]
1151
1164
1152
1165
<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
1153
- -> removed dependency.1
1166
+ -> removed dependency.2
1154
1167
-> installed dependency.3
1155
1168
Done.
1156
1169
### opam pin | '\(at [a-f0-9]+\)' -> '(at HASH)'
Original file line number Diff line number Diff line change @@ -256,7 +256,11 @@ Done.
256
256
opam-version: "2.0"
257
257
depends: ["qux" {= "1"}]
258
258
### opam install ./ongoing --working-dir --show-action
259
- [NOTE] Package ongoing is already installed (current version is dev).
259
+ The following actions would be performed:
260
+ === downgrade 1 package
261
+ - downgrade qux 4 to 1 [required by ongoing]
262
+ === recompile 1 package
263
+ - recompile ongoing dev (pinned)
260
264
### opam reinstall ./ongoing --working-dir --show-action
261
265
262
266
<><> Synchronising pinned packages ><><><><><><><><><><><><><><><><><><><><><><>
You can’t perform that action at this time.
0 commit comments