Skip to content

Commit

Permalink
Fix incorrect reverting of =+ and =:
Browse files Browse the repository at this point in the history
  • Loading branch information
dra27 committed May 2, 2024
1 parent ae20044 commit d1b865d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/state/opamEnv.ml
Original file line number Diff line number Diff line change
Expand Up @@ -369,15 +369,15 @@ let reverse_env_update ~sepfmt var op arg cur_value =
| EqPlus | Cygwin ->
(match unzip_to ~sepfmt var arg (List.rev cur_value) with
| None -> None
| Some (rl1, l2) -> Some (List.rev l2, List.rev rl1))
| Some (rl1, l2) -> Some (l2, List.rev rl1))
| ColonEq ->
(match unzip_to var ~sepfmt arg cur_value with
| Some ([], [("", _, _)]) -> Some ([], [])
| r -> r)
| EqColon ->
(match unzip_to ~sepfmt var arg (List.rev cur_value) with
| Some ([], [("", _, _)]) -> Some ([], [])
| Some (rl1, l2) -> Some (List.rev l2, List.rev rl1)
| Some (rl1, l2) -> Some (l2, List.rev rl1)
| None -> None)

let map_update_names env_keys updates =
Expand Down
24 changes: 12 additions & 12 deletions tests/reftests/env.test
Original file line number Diff line number Diff line change
Expand Up @@ -273,27 +273,27 @@ NV_VARS_5925_8='': export NV_VARS_5925_8:
NV_VARS_5926_L_1='': export NV_VARS_5926_L_1:
NV_VARS_5926_L_2=':a': export NV_VARS_5926_L_2:
NV_VARS_5926_L_3='': export NV_VARS_5926_L_3:
NV_VARS_5926_L_4='a:': export NV_VARS_5926_L_4:
NV_VARS_5926_L_4=':a': export NV_VARS_5926_L_4:
NV_VARS_5926_L_5='': export NV_VARS_5926_L_5:
NV_VARS_5926_L_6=':a': export NV_VARS_5926_L_6:
NV_VARS_5926_L_7='': export NV_VARS_5926_L_7:
NV_VARS_5926_L_8='a:': export NV_VARS_5926_L_8:
NV_VARS_5926_L_8=':a': export NV_VARS_5926_L_8:
NV_VARS_5926_M_1='a1::a2': export NV_VARS_5926_M_1:
NV_VARS_5926_M_2='a2::a1': export NV_VARS_5926_M_2:
NV_VARS_5926_M_2='a1::a2': export NV_VARS_5926_M_2:
NV_VARS_5926_M_3='a1::a2': export NV_VARS_5926_M_3:
NV_VARS_5926_M_4='a2::a1': export NV_VARS_5926_M_4:
NV_VARS_5926_M_4='a1::a2': export NV_VARS_5926_M_4:
NV_VARS_5926_S_1='': export NV_VARS_5926_S_1:
NV_VARS_5926_S_2='': export NV_VARS_5926_S_2:
NV_VARS_5926_S_3='': export NV_VARS_5926_S_3:
NV_VARS_5926_S_4='': export NV_VARS_5926_S_4:
NV_VARS_5926_T_1='': export NV_VARS_5926_T_1:
NV_VARS_5926_T_2='a:': export NV_VARS_5926_T_2:
NV_VARS_5926_T_3='': export NV_VARS_5926_T_3:
NV_VARS_5926_T_4=':a': export NV_VARS_5926_T_4:
NV_VARS_5926_T_4='a:': export NV_VARS_5926_T_4:
NV_VARS_5926_T_5='': export NV_VARS_5926_T_5:
NV_VARS_5926_T_6='a:': export NV_VARS_5926_T_6:
NV_VARS_5926_T_7='': export NV_VARS_5926_T_7:
NV_VARS_5926_T_8=':a': export NV_VARS_5926_T_8:
NV_VARS_5926_T_8='a:': export NV_VARS_5926_T_8:
### NV_VARS=/another/path
### NV_VARS2=/another/different/path
### NV_VARS3=/yet/another/different/path
Expand Down Expand Up @@ -384,27 +384,27 @@ NV_VARS_5925_8='': export NV_VARS_5925_8:
NV_VARS_5926_L_1='': export NV_VARS_5926_L_1:
NV_VARS_5926_L_2=':a': export NV_VARS_5926_L_2:
NV_VARS_5926_L_3='': export NV_VARS_5926_L_3:
NV_VARS_5926_L_4='a:': export NV_VARS_5926_L_4:
NV_VARS_5926_L_4=':a': export NV_VARS_5926_L_4:
NV_VARS_5926_L_5='': export NV_VARS_5926_L_5:
NV_VARS_5926_L_6=':a': export NV_VARS_5926_L_6:
NV_VARS_5926_L_7='': export NV_VARS_5926_L_7:
NV_VARS_5926_L_8='a:': export NV_VARS_5926_L_8:
NV_VARS_5926_L_8=':a': export NV_VARS_5926_L_8:
NV_VARS_5926_M_1='a1::a2': export NV_VARS_5926_M_1:
NV_VARS_5926_M_2='a2::a1': export NV_VARS_5926_M_2:
NV_VARS_5926_M_2='a1::a2': export NV_VARS_5926_M_2:
NV_VARS_5926_M_3='a1::a2': export NV_VARS_5926_M_3:
NV_VARS_5926_M_4='a2::a1': export NV_VARS_5926_M_4:
NV_VARS_5926_M_4='a1::a2': export NV_VARS_5926_M_4:
NV_VARS_5926_S_1='': export NV_VARS_5926_S_1:
NV_VARS_5926_S_2='': export NV_VARS_5926_S_2:
NV_VARS_5926_S_3='': export NV_VARS_5926_S_3:
NV_VARS_5926_S_4='': export NV_VARS_5926_S_4:
NV_VARS_5926_T_1='': export NV_VARS_5926_T_1:
NV_VARS_5926_T_2='a:': export NV_VARS_5926_T_2:
NV_VARS_5926_T_3='': export NV_VARS_5926_T_3:
NV_VARS_5926_T_4=':a': export NV_VARS_5926_T_4:
NV_VARS_5926_T_4='a:': export NV_VARS_5926_T_4:
NV_VARS_5926_T_5='': export NV_VARS_5926_T_5:
NV_VARS_5926_T_6='a:': export NV_VARS_5926_T_6:
NV_VARS_5926_T_7='': export NV_VARS_5926_T_7:
NV_VARS_5926_T_8=':a': export NV_VARS_5926_T_8:
NV_VARS_5926_T_8='a:': export NV_VARS_5926_T_8:
### : Full revert of uninstalled package with setenv :
### <pkg:foo.1>
opam-version: "2.0"
Expand Down

0 comments on commit d1b865d

Please sign in to comment.