Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Modify sed expression to make it accessible to both GNU and BSD sed

  • Loading branch information...
commit 5b71cd757115b57b5dcd967995c565d7c4c23925 1 parent 87791ce
@fperrin fperrin authored
Showing with 5 additions and 5 deletions.
  1. +3 −3 build/myocamlbuild_prefix.ml
  2. +2 −2 build_rules.ml
View
6 build/myocamlbuild_prefix.ml
@@ -319,11 +319,11 @@ let _ = dispatch begin function
~dep:"%.mllibp"
~prod:"%.mllib"
(fun env _build ->
- let tags = String.uppercase (String.concat "\\|" Config.available) in
+ let tags = String.uppercase (String.concat "|" Config.available) in
let sedexpr =
- Printf.sprintf "s/^?HAS_\\(%s\\)://; t OK; /^?HAS_.*:/d; :OK" tags
+ Printf.sprintf "s/^\\?HAS_(%s)://; /HAS_.*:/d" tags
in
- Cmd(S[sed; A sedexpr; P(env "%.mllibp"); Sh">"; P(env "%.mllib")]));
+ Cmd(S[sed; A"-r"; A sedexpr; P(env "%.mllibp"); Sh">"; P(env "%.mllib")]));
(* Windows specific : redefinition of an existing rule in Ocaml_specific.ml,
Louis please have a look to avoid the two copies at the end
View
4 build_rules.ml
@@ -650,8 +650,8 @@ rule "opadep: .opa -> .opa.depends"
~dep: "%.opa"
~prod: "%.opa.depends"
(fun env build ->
- let dep_regex = "^ *import \\+\\(.\\+\\)$" in
- Cmd(S[sed; A("s%"^dep_regex^"%\\1.opx%; t OK; d; :OK s% %%g"); P(env "%.opa");
+ let dep_regex = "^ *import \\*\\(.\\+\\) *$" in
+ Cmd(S[sed; A"-n"; A("s%"^dep_regex^"%\\1.opx%p"); P(env "%.opa");
Sh">";P(env "%.opa.depends")]));
rule "opacomp: .opa -> .native"
Please sign in to comment.
Something went wrong with that request. Please try again.