53
53
54
54
type t = {
55
55
root_dir : OpamFilename.Dir .t ;
56
+ original_root_dir : OpamFilename.Dir .t ;
56
57
current_switch : OpamSwitch .t option ;
57
58
switch_from : provenance ;
58
59
jobs : int Lazy .t ;
@@ -86,6 +87,7 @@ let default = {
86
87
in
87
88
concat_and_resolve local_appdata " opam"
88
89
);
90
+ original_root_dir = default_root () ;
89
91
current_switch = None ;
90
92
switch_from = `Default ;
91
93
jobs = lazy (max 1 (OpamSysPoll. cores () - 1 ));
@@ -108,6 +110,7 @@ let default = {
108
110
109
111
type 'a options_fun =
110
112
?root_dir:OpamFilename.Dir .t ->
113
+ ?original_root_dir:OpamFilename.Dir .t ->
111
114
?current_switch:OpamSwitch .t ->
112
115
?switch_from:provenance ->
113
116
?jobs:(int Lazy .t ) ->
@@ -126,6 +129,7 @@ type 'a options_fun =
126
129
127
130
let setk k t
128
131
?root_dir
132
+ ?original_root_dir
129
133
?current_switch
130
134
?switch_from
131
135
?jobs
@@ -144,6 +148,7 @@ let setk k t
144
148
let (+) x opt = match opt with Some x -> x | None -> x in
145
149
k {
146
150
root_dir = t.root_dir + root_dir;
151
+ original_root_dir = t.original_root_dir + original_root_dir;
147
152
current_switch =
148
153
(match current_switch with None -> t.current_switch | s -> s);
149
154
switch_from = t.switch_from + switch_from;
@@ -176,6 +181,7 @@ let initk k =
176
181
in
177
182
setk (setk (fun c -> r := c; k)) ! r
178
183
?root_dir:(E. root () >> | OpamFilename.Dir. of_string)
184
+ ?original_root_dir:(E. root () >> | OpamFilename.Dir. of_string)
179
185
?current_switch
180
186
?switch_from
181
187
?jobs:(E. jobs () >> | fun s -> lazy s)
0 commit comments