Skip to content

Commit

Permalink
Use it to enhance the BASEDIR / OPAMTMP detection
Browse files Browse the repository at this point in the history
  • Loading branch information
dra27 authored and rjbou committed Nov 28, 2023
1 parent 452af28 commit 85a7a23
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ users)

### Engine
* Set `SHELL` to `/bin/sh` in Windows to ensure `opam env` commands are consistent [#5723 @dra27]
* Substitution for `BASEDIR` and `OPAMTMP` now recognise the directory with either forward-slashes, back-slashes, or converted to Cygwin notation (i.e. C:\cygwin64\tmp\..., C:/cygwin64/tmp/..., or /tmp/...) [#5723 @dra27]

## Github Actions

Expand Down
10 changes: 7 additions & 3 deletions tests/reftests/run.ml
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,11 @@ let parse_command = Parse.command
let common_filters ?opam dir =
let tmpdir = OpamSystem.real_path (Filename.get_temp_dir_name ()) in
let open Re in
let dir_to_regex dir =
if Sys.win32 then
[str dir; str (OpamSystem.back_to_forward dir); str (OpamSystem.apply_cygpath dir)]
else
[str dir] in
[
seq [ bol;
alt [ str "#=== ERROR";
Expand All @@ -554,11 +559,10 @@ let common_filters ?opam dir =
GrepV;
seq [bol; str cmd_prompt],
Sed "##% ";
alt [str dir; str (OpamSystem.back_to_forward dir)],
alt (dir_to_regex dir),
Sed "${BASEDIR}";
seq [
alt [str tmpdir;
str (OpamSystem.back_to_forward tmpdir)];
alt (dir_to_regex tmpdir);
rep (set "/\\");
str "opam-";
rep1 (alt [xdigit; char '-'])],
Expand Down

0 comments on commit 85a7a23

Please sign in to comment.