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