Commit 255328c 1 parent ca32ab3 commit 255328c Copy full SHA for 255328c
File tree 6 files changed +11
-5
lines changed
6 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -114,6 +114,7 @@ users)
114
114
## opam-repository
115
115
116
116
## opam-state
117
+ * ` OpamStateConfig.opamroot_with_provenance ` : restore previous behaviour to ` OpamStateConfig.opamroot ` for compatibility with third party code [ #6047 @dra27 ]
117
118
118
119
## opam-solver
119
120
Original file line number Diff line number Diff line change @@ -181,7 +181,7 @@ let check_and_run_external_commands () =
181
181
let yes = if yes then Some (Some true ) else None in
182
182
OpamCoreConfig. init ?yes ?confirm_level () ;
183
183
OpamFormatConfig. init () ;
184
- let root_from, root_dir = OpamStateConfig. opamroot () in
184
+ let root_from, root_dir = OpamStateConfig. opamroot_with_provenance () in
185
185
let has_init, root_upgraded =
186
186
match OpamStateConfig. load_defaults ~lock_kind: `Lock_read root_dir with
187
187
| None -> (false , false )
Original file line number Diff line number Diff line change @@ -209,7 +209,7 @@ let opam_init ?root_dir ?strict ?solver =
209
209
let open OpamStd.Option.Op in
210
210
211
211
(* (i) get root dir *)
212
- let root_from, root = OpamStateConfig. opamroot ?root_dir () in
212
+ let root_from, root = OpamStateConfig. opamroot_with_provenance ?root_dir () in
213
213
214
214
(* (ii) load conf file and set defaults *)
215
215
(* the init for OpamFormat is done in advance since (a) it has an effect on
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ let global_options cli =
94
94
switch_to_updated_self
95
95
OpamStd.Option.Op. (options.debug_level ++
96
96
OpamCoreConfig.E. debug () +! 0 |> abs > 0 )
97
- (snd ( OpamStateConfig. opamroot ?root_dir:options.opt_root ( ) ));
97
+ (OpamStateConfig. opamroot ?root_dir:options.opt_root ( ));
98
98
let root_is_ok =
99
99
OpamStd.Option. default false (OpamClientConfig.E. rootisok () )
100
100
in
Original file line number Diff line number Diff line change @@ -223,7 +223,7 @@ let initk k =
223
223
224
224
let init ?noop :_ = initk (fun () -> () )
225
225
226
- let opamroot ?root_dir () =
226
+ let opamroot_with_provenance ?root_dir () =
227
227
match root_dir with
228
228
| Some root -> `Command_line , win_space_redirection root
229
229
| None ->
@@ -233,6 +233,8 @@ let opamroot ?root_dir () =
233
233
| None ->
234
234
`Default , default.root_dir
235
235
236
+ let opamroot ?root_dir () = snd (opamroot_with_provenance ?root_dir () )
237
+
236
238
let is_newer_raw = function
237
239
| Some v ->
238
240
OpamVersion. compare v OpamFile.Config. root_version > 0
Original file line number Diff line number Diff line change @@ -86,7 +86,10 @@ val default : t
86
86
(* * Get the initial opam root value (from default, env or optional argument).
87
87
This allows one to get it before doing the init, which is useful to get the
88
88
configuration file used to fill some options to init() *)
89
- val opamroot : ?root_dir : dirname -> unit -> provenance * dirname
89
+ val opamroot_with_provenance : ?root_dir : dirname -> unit -> provenance * dirname
90
+
91
+ (* * [opamroot ?root_dir () = snd (opamroot_with_provenance ?root_dir ()] *)
92
+ val opamroot : ?root_dir : dirname -> unit -> dirname
90
93
91
94
(* * Loads the global configuration file, protecting against concurrent writes *)
92
95
val load : ?lock_kind : 'a lock -> dirname -> OpamFile.Config .t option
You can’t perform that action at this time.
0 commit comments