Skip to content

Commit

Permalink
Do not generate the _oasis_remove_.ml file (no longer needed)
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris00 committed Dec 8, 2016
1 parent 6bcb2b4 commit 77b07e3
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 30 deletions.
7 changes: 0 additions & 7 deletions _oasis_remove_.ml

This file was deleted.

1 change: 0 additions & 1 deletion oasis2opam.install
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ etc: [
"setup.ml"
"setup.data"
"setup.log"
"_oasis_remove_.ml"
]
3 changes: 2 additions & 1 deletion opam/opam
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ build: [
]
install: ["ocaml" "setup.ml" "-install"]
remove: [
["ocaml" "%{etc}%/oasis2opam/_oasis_remove_.ml" "%{etc}%/oasis2opam"]
["ocaml" "%{etc}%/oasis2opam/setup.ml" "-C" "%{etc}%/oasis2opam"
"-uninstall"]
]
build-test: [
["oasis" "setup"]
Expand Down
28 changes: 10 additions & 18 deletions src/Install.ml
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,6 @@ let opam t ~local flags =
)


let remove_script = "_oasis_remove_.ml"

(** Write an .install file to save oasis setup.* in order to be able
to also use oasis for removal. Never put these files in the
repository itself because they are a hack. *)
Expand All @@ -208,20 +206,14 @@ let oasis t ~local =
fprintf ppf "@[<2>etc: [@\n\
\"setup.ml\"@\n\
\"setup.data\"@\n\
\"setup.log\"@\n\
\"%s\"\
@]@\n]@\n%!" remove_script;
\"setup.log\"\
@]@\n]@\n%!";
);
(* oasis setup.ml looks for setup.data in the current working
directory and it is not clear there is a protable way to change
do that in OPAM. This script must be in sync. with how it is
called from the "remove:" section. *)
let script =
"open Printf\n\n\
let () =\n \
let dir = Sys.argv.(1) in\n \
(try Sys.chdir dir\n \
with _ -> eprintf \"Cannot change directory to %s\\n%!\" dir);\n \
exit (Sys.command \"ocaml setup.ml -uninstall\")\n" in
with_file t remove_script ~local ~warn:true
(fun ppf -> fprintf ppf "%s" script)
(* Warn about obsolete file. *)
let dir = Filename.concat (Tarball.pkg_opam_dir t) "files" in
let remove_script = "_oasis_remove_.ml" in
let full_fname = if local then remove_script
else Filename.concat dir remove_script in
if Sys.file_exists full_fname then
info(sprintf "The file %S is no longer needed. Please remove it."
full_fname)
6 changes: 3 additions & 3 deletions src/oasis2opam.ml
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ let output_build_install t fmt flags opam_file_version ~remove_with_oasis =
Format.fprintf fmt "@[<2>remove: [";
if remove_with_oasis then
(* setup.{ml,data,log} were saved by OPAM during install. *)
Format.fprintf fmt "@\n@[<2>[\"ocaml\" \"%%{etc}%%/%s/%s\"@ \
\"%%{etc}%%/%s\"@]]"
pkg.name Install.remove_script pkg.name
Format.fprintf fmt "@\n@[<2>[\"ocaml\" \"%%{etc}%%/%s/setup.ml\"@ \
\"-C\" \"%%{etc}%%/%s\"@ \"-uninstall\"@]]"
pkg.name pkg.name
else
List.iter (fun l -> Format.fprintf fmt "@\n[\"ocamlfind\" \"remove\" %S]" l
) libs;
Expand Down

0 comments on commit 77b07e3

Please sign in to comment.