Skip to content

Commit

Permalink
Fix opam-admin.top
Browse files Browse the repository at this point in the history
Two problems from the Jbuilder upgrade:

1. opam_admin_top.cmi should be installed
2. Opam_admin_top functions were not available, because Topmain was
   invoked from within Opam_admin_top.

Signed-off-by: David Allsopp <[email protected]>
  • Loading branch information
dra27 committed Sep 3, 2017
1 parent 094d535 commit f462137
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ opam-installer: $(DUNE_DEP)
$(LN_S) -f _build/default/src/tools/opam_installer.exe $@$(EXE)

opam-admin.top: $(DUNE_DEP)
$(DUNE) build --profile=$(DUNE_PROFILE) $(DUNE_ARGS) src/tools/opam_admin_top.bc
$(LN_S) -f _build/default/src/tools/opam_admin_top.bc $@$(EXE)
$(DUNE) build --profile=$(DUNE_PROFILE) $(DUNE_ARGS) src/tools/opam_admin_topstart.bc
$(LN_S) -f _build/default/src/tools/opam_admin_topstart.bc $@$(EXE)

lib-ext:
$(MAKE) -j -C src_ext lib-ext
Expand Down
22 changes: 15 additions & 7 deletions src/tools/dune
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
(executable
(library
(name opam_admin_top)
(public_name opam-admin.top)
(synopsis "OCaml Package Manager admin toplevel")
(modules opam_admin_top)
(libraries opam-client opam-file-format compiler-libs.toplevel re)
(wrapped false))

(executable
(name opam_admin_topstart)
(public_name opam-admin.top)
(package opam-admin)
(modes byte)
(modules opam_admin_topstart)
(libraries opam-admin.top)
(ocamlc_flags (:standard
(:include ../ocaml-flags-standard.sexp)
(:include ../ocaml-flags-configure.sexp)
(:include ../ocaml-context-flags.sexp)
-linkall))
(libraries opam-client opam-file-format compiler-libs.toplevel re))
-linkall)))

(install
(section bin)
(package opam-admin)
(files (opam_admin_top.bc as opam-admin.top)))
(rule (with-stdout-to opam_admin_topstart.ml (echo "include Opam_admin_top\n\nlet _ = Topmain.main ()")))

(executable
(name opam_check)
Expand Down
2 changes: 0 additions & 2 deletions src/tools/opam_admin_top.ml
Original file line number Diff line number Diff line change
Expand Up @@ -128,5 +128,3 @@ let filter fn patterns =
List.exists (fun re -> OpamStd.String.exact_match re str) regexps

let filter_packages = filter OpamPackage.to_string

let _ = Topmain.main ()

0 comments on commit f462137

Please sign in to comment.