diff -Nru findlib-1.7.1/configure findlib-1.7.3/configure --- findlib-1.7.1/configure 2016-11-18 13:04:45.000000000 +0000 +++ findlib-1.7.3/configure 2017-06-05 14:32:28.000000000 +0000 @@ -7,7 +7,7 @@ #set -x -version="1.7.1" +version="1.7.3" # Remember the old IFS value: oldifs="$IFS" @@ -119,6 +119,7 @@ with_camlp4=1 custom=-custom system="" +sh="" while [ "$#" != "0" ]; do case "$1" in @@ -246,6 +247,13 @@ esac ###################################################################### +# check for presence of /bin/sh + +if [ ! -f /bin/sh ]; then + sh=sh +fi + +###################################################################### # Find out standard library location ocaml_core_stdlib=`get_stdlib` @@ -514,6 +522,18 @@ ldbm="" fi +# num? + +if [ -f "${ocaml_core_stdlib}/num.cmi" ]; then + echo "num: found" + lnum="num num-top" + numtop="num-top" +else + echo "num: not present (normal since OCaml-4.06)" + lnum="" + numtop="" +fi + # bytes? if [ -f "${ocaml_core_stdlib}/bytes.cmi" ]; then @@ -539,7 +559,7 @@ # Generate the META files now. -l="$ldbm dynlink graphics num num-top str threads unix stdlib bigarray ocamldoc $llabltk $lcamlp4 $lobuild $lcomplibs $lbytes $lspacetime" +l="$ldbm dynlink graphics $lnum str threads unix stdlib bigarray ocamldoc $llabltk $lcamlp4 $lobuild $lcomplibs $lbytes $lspacetime" for dir in site-lib-src/*; do # We do not really know if $dir is a directory. @@ -623,6 +643,8 @@ echo "VERSION=${version}" >>Makefile.config echo "ENABLE_TOPFIND_PPXOPT=${enable_topfind_ppxopt}" >>Makefile.config echo "SYSTEM=${system}" >>Makefile.config +echo "NUMTOP=${numtop}" >>Makefile.config +echo "SH=${sh}" >>Makefile.config if [ "$mingw_lib" != "" ]; then echo "OCAMLC_FLAGS=-I \"${mingw_lib}\"" >>Makefile.config echo "OCAMLOPT_FLAGS=-I \"${mingw_lib}\"" >>Makefile.config diff -Nru findlib-1.7.1/debian/changelog findlib-1.7.3/debian/changelog --- findlib-1.7.1/debian/changelog 2017-03-04 23:07:03.000000000 +0000 +++ findlib-1.7.3/debian/changelog 2017-09-16 11:54:42.000000000 +0000 @@ -1,3 +1,17 @@ +findlib (1.7.3-2) unstable; urgency=medium + + * Upload to unstable. + * Remove Nicolas Dandrimont from Uploaders as requested by him. + + -- Ximin Luo Sat, 16 Sep 2017 13:54:42 +0200 + +findlib (1.7.3-1) experimental; urgency=medium + + * New upstream release. + * Update to latest Standards-Version; no changes required. + + -- Ximin Luo Sat, 29 Jul 2017 16:09:53 +0200 + findlib (1.7.1-2) experimental; urgency=medium * Fix build on non-dynlink arches. diff -Nru findlib-1.7.1/debian/control findlib-1.7.3/debian/control --- findlib-1.7.1/debian/control 2017-03-03 19:29:35.000000000 +0000 +++ findlib-1.7.3/debian/control 2017-07-29 14:58:48.000000000 +0000 @@ -5,7 +5,6 @@ Uploaders: Mehdi Dogguy , Stéphane Glondu , - Nicolas Dandrimont , Ximin Luo Build-Depends: debhelper (>= 9), @@ -15,7 +14,7 @@ m4, gawk | awk, dh-ocaml (>= 0.9~) -Standards-Version: 3.9.8 +Standards-Version: 4.0.0 Vcs-Git: https://anonscm.debian.org/git/pkg-ocaml-maint/packages/findlib.git Vcs-Browser: https://anonscm.debian.org/git/pkg-ocaml-maint/packages/findlib.git Homepage: http://projects.camlcity.org/projects/findlib.html diff -Nru findlib-1.7.1/debian/libfindlib-ocaml.install.in findlib-1.7.3/debian/libfindlib-ocaml.install.in --- findlib-1.7.1/debian/libfindlib-ocaml.install.in 2017-03-04 23:04:47.000000000 +0000 +++ findlib-1.7.3/debian/libfindlib-ocaml.install.in 2017-07-29 13:58:02.000000000 +0000 @@ -15,4 +15,4 @@ @OCamlStdlibDir@/bigarray/META @OCamlStdlibDir@/compiler-libs/META @OCamlStdlibDir@/threads/META -64: @OCamlStdlibDir@/raw_spacetime/META +@OCamlStdlibDir@/raw_spacetime/META diff -Nru findlib-1.7.1/debian/rules findlib-1.7.3/debian/rules --- findlib-1.7.1/debian/rules 2017-03-04 22:59:41.000000000 +0000 +++ findlib-1.7.3/debian/rules 2017-07-29 14:06:28.000000000 +0000 @@ -26,10 +26,9 @@ $(MAKE) opt endif -ifeq ($(DEB_BUILD_ARCH_BITS),64) - OCAMLINIT_SED += -e 's/^64: //' -else - OCAMLINIT_SED += -e '/^64: /d' +# Some platforms don't have raw_spacetime, do the same check as ./configure +ifeq (,$(wildcard $(OCAML_STDLIB_DIR)/raw_spacetime_lib.cmxa)) + OCAMLINIT_SED += -e '\,raw_spacetime/META,d' endif export OCAMLINIT_SED diff -Nru findlib-1.7.1/doc/README findlib-1.7.3/doc/README --- findlib-1.7.1/doc/README 2016-11-18 13:04:46.000000000 +0000 +++ findlib-1.7.3/doc/README 2017-06-05 14:32:29.000000000 +0000 @@ -85,6 +85,16 @@ List of Changes ============================================================================== +- 1.7.3: Fix regarding num-top: this library is now also optional, as num. + +- 1.7.2: Trying to protect against failures when several package installs are + done in parallel. + New subpackage "findlib.top" for the toploop (Jeremie Dimino). + The "num" library is now optional. + Shell scripts are started via "sh" command when there is no /bin/sh (ygrek) + +- 1.7.1: added missing file to tarball + - 1.7.0: New command "ocamlfind printppx" that outputs how the ppx preprocessor would be called (Hendrik Tews). Support for the raw_spacetime library that comes with OCaml 4.04 (Gerd diff -Nru findlib-1.7.1/doc/README.xml findlib-1.7.3/doc/README.xml --- findlib-1.7.1/doc/README.xml 2016-11-18 13:04:46.000000000 +0000 +++ findlib-1.7.3/doc/README.xml 2017-06-05 14:32:29.000000000 +0000 @@ -110,6 +110,23 @@
  • +

    1.7.3: Fix regarding num-top: this library is now also + optional, as num.

    +
  • + +
  • +

    1.7.2: Trying to protect against failures when + several package installs are done in parallel.

    + +

    New subpackage "findlib.top" for the toploop (Jeremie Dimino).

    + +

    The "num" library is now optional.

    + +

    Shell scripts are started via "sh" command when there is no + /bin/sh (ygrek)

    +
  • + +
  • 1.7.1: added missing file to tarball

  • diff -Nru findlib-1.7.1/Makefile findlib-1.7.3/Makefile --- findlib-1.7.1/Makefile 2016-11-18 13:04:45.000000000 +0000 +++ findlib-1.7.3/Makefile 2017-06-05 14:32:28.000000000 +0000 @@ -22,7 +22,7 @@ $(MAKE) install-config for p in $(PARTS); do ( cd src/$$p; $(MAKE) install ); done $(MAKE) install-meta - cd src/findlib; $(MAKE) install-num-top + test -z "$(NUMTOP)" || { cd src/findlib; $(MAKE) install-num-top; } if [ $(INSTALL_CAMLP4) -eq 1 ]; then \ cp tools/safe_camlp4 "$(prefix)$(OCAMLFIND_BIN)"; \ fi @@ -55,7 +55,7 @@ USE_CYGPATH="$(USE_CYGPATH)"; \ export USE_CYGPATH; \ cat findlib.conf.in | \ - tools/patch '@SITELIB@' '$(OCAML_SITELIB)' >findlib.conf + $(SH) tools/patch '@SITELIB@' '$(OCAML_SITELIB)' >findlib.conf if ./tools/cmd_from_same_dir ocamlc; then \ echo 'ocamlc="ocamlc.opt"' >>findlib.conf; \ fi diff -Nru findlib-1.7.1/src/findlib/frontend.ml findlib-1.7.3/src/findlib/frontend.ml --- findlib-1.7.1/src/findlib/frontend.ml 2016-11-18 13:04:46.000000000 +0000 +++ findlib-1.7.3/src/findlib/frontend.ml 2017-06-05 14:32:29.000000000 +0000 @@ -25,6 +25,11 @@ | Plus ;; +let sys_error code arg = + if arg = "" then + Sys_error (Unix.error_message code) + else + Sys_error (arg ^ ": " ^ Unix.error_message code) let slashify s = @@ -1859,14 +1864,27 @@ else file ^ ".owner" in (List.mem owner_file files) && ( - let f = open_in (Filename.concat dir owner_file) in - try - let line = input_line f in - let is_my_file = (line = pkg) in - close_in f; - is_my_file - with - exc -> close_in f; raise exc + try + let fd = + Unix.openfile (Filename.concat dir owner_file) [Unix.O_RDONLY] 0 in + let f = + Unix.in_channel_of_descr fd in + try + let line = input_line f in + let is_my_file = (line = pkg) in + close_in f; + is_my_file + with + | End_of_file -> close_in f; false + | exc -> close_in f; raise exc + with + | Unix.Unix_error(Unix.ENOENT,_,_) -> + (* the owner file might have been removed by a package + removal that is being done in parallel + *) + false + | Unix.Unix_error(code, _, arg) -> + raise(sys_error code arg) ) ) files @@ -2118,7 +2136,7 @@ (* Create the package directory: *) install_create_directory !pkgname pkgdir; - (* Now copy the files into the package directory: *) + (* Now copy the files into the package directory (except META): *) List.iter (fun p -> try @@ -2135,38 +2153,6 @@ ) pkgdir_list; - (* Now write the META file: *) - let write_meta append_directory dir name = - (* If there are patches, write the patched META, else copy the file: *) - if !patches = [] then - copy_file - ~rename:(fun _ -> name) - ?append:(if append_directory then - Some("\ndirectory=\"" ^ pkgdir ^ - "\" # auto-added by ocamlfind\n") - else - None) - meta_name - dir - else ( - let p = Filename.concat dir name in - let patched_pkg = patch_pkg pkgdir meta_pkg !patches in - let out = open_out p in - Fl_metascanner.print out patched_pkg; - if append_directory then - output_string out ("\ndirectory=\"" ^ pkgdir ^ - "\" # auto-added by ocamlfind\n"); - close_out out; - prerr_endline ("Installed " ^ p); - ) - in - if not !add_files then ( - if has_metadir then - write_meta true !metadir meta_dot_pkg - else - write_meta false pkgdir "META"; - ); - (* Copy the DLLs into the libexec directory if necessary *) if have_libexec then begin List.iter @@ -2209,6 +2195,38 @@ prerr_endline("ocamlfind: [WARNING] You have installed DLLs but the directory " ^ dlldir_norm ^ " is not mentioned in ld.conf"); end; + (* Finally, write the META file: *) + let write_meta append_directory dir name = + (* If there are patches, write the patched META, else copy the file: *) + if !patches = [] then + copy_file + ~rename:(fun _ -> name) + ?append:(if append_directory then + Some("\ndirectory=\"" ^ pkgdir ^ + "\" # auto-added by ocamlfind\n") + else + None) + meta_name + dir + else ( + let p = Filename.concat dir name in + let patched_pkg = patch_pkg pkgdir meta_pkg !patches in + let out = open_out p in + Fl_metascanner.print out patched_pkg; + if append_directory then + output_string out ("\ndirectory=\"" ^ pkgdir ^ + "\" # auto-added by ocamlfind\n"); + close_out out; + prerr_endline ("Installed " ^ p); + ) + in + if not !add_files then ( + if has_metadir then + write_meta true !metadir meta_dot_pkg + else + write_meta false pkgdir "META"; + ); + (* Check if there is a postinstall script: *) let postinstall = Filename.concat !destdir "postinstall" in if Sys.file_exists postinstall then @@ -2277,57 +2295,80 @@ Unix.Unix_error(_,_,_) -> () (* ignore, it's only a warning *) end; + (* First remove the META file. If it is already gone, assume that a + parallel running removal removed it already. + *) + (* If there is a metadir, remove the META file from it: *) - if has_metadir then begin - let f = Filename.concat !metadir meta_dot_pkg in - if Sys.file_exists f then begin - Sys.remove f; - prerr_endline ("Removed " ^ f); + let meta_removal_ok = + if has_metadir then ( + let f = Filename.concat !metadir meta_dot_pkg in + try + Unix.unlink f; + prerr_endline ("Removed " ^ f); + true + with + | Unix.Unix_error(Unix.ENOENT,_,_) -> + prerr_endline ("ocamlfind: [WARNING] No such file: " ^ f); + false + | Unix.Unix_error(code, _, arg) -> + raise(sys_error code arg) + ) else + let f = Filename.concat pkgdir "META" in + try + Unix.unlink f; + prerr_endline ("Removed " ^ f); + true + with + | Unix.Unix_error(Unix.ENOENT,_,_) -> + prerr_endline ("ocamlfind: [WARNING] No such file: " ^ f); + false + | Unix.Unix_error(code, _, arg) -> + raise(sys_error code arg) in + + if meta_removal_ok then ( + + (* Remove files from libexec directory: *) + if have_libexec then begin + let dll_files = find_owned_files !pkgname dlldir in + List.iter + (fun file -> + let absfile = Filename.concat dlldir file in + Sys.remove absfile; + prerr_endline ("Removed " ^ absfile) + ) + dll_files + end; + + (* Remove the files from the package directory: *) + if Sys.file_exists pkgdir then begin + let files = Sys.readdir pkgdir in + Array.iter (fun f -> Sys.remove (Filename.concat pkgdir f)) files; + Unix.rmdir pkgdir; + prerr_endline ("Removed " ^ pkgdir) end else - prerr_endline ("ocamlfind: [WARNING] No such file: " ^ f) - end; - - (* Remove files from libexec directory: *) - if have_libexec then begin - let dll_files = find_owned_files !pkgname dlldir in - List.iter - (fun file -> - let absfile = Filename.concat dlldir file in - Sys.remove absfile; - prerr_endline ("Removed " ^ absfile) - ) - dll_files - end; + prerr_endline("ocamlfind: [WARNING] No such directory: " ^ pkgdir); - (* Remove the files from the package directory: *) - if Sys.file_exists pkgdir then begin - let files = Sys.readdir pkgdir in - Array.iter (fun f -> Sys.remove (Filename.concat pkgdir f)) files; - Unix.rmdir pkgdir; - prerr_endline ("Removed " ^ pkgdir) - end - else - prerr_endline("ocamlfind: [WARNING] No such directory: " ^ pkgdir); - - (* Modify ld.conf *) - if !ldconf <> "ignore" then begin - if Sys.file_exists !ldconf then - begin - let lines = read_ldconf !ldconf in - let d = Fl_split.norm_dir pkgdir in - let exists = List.exists (fun p -> Fl_split.norm_dir p = d) lines in - if exists then begin - let lines' = List.filter (fun p -> Fl_split.norm_dir p <> d) lines in - write_ldconf !ldconf lines' [] - end - end - end; + (* Modify ld.conf *) + if !ldconf <> "ignore" then begin + if Sys.file_exists !ldconf then + begin + let lines = read_ldconf !ldconf in + let d = Fl_split.norm_dir pkgdir in + let exists = List.exists (fun p -> Fl_split.norm_dir p = d) lines in + if exists then begin + let lines' = List.filter (fun p -> Fl_split.norm_dir p <> d) lines in + write_ldconf !ldconf lines' [] + end + end + end; - (* Check if there is a postremove script: *) - let postremove = Filename.concat !destdir "postremove" in - if Sys.file_exists postremove then - run_command Verbose postremove [ slashify !destdir; !pkgname ] + (* Check if there is a postremove script: *) + let postremove = Filename.concat !destdir "postremove" in + if Sys.file_exists postremove then + run_command Verbose postremove [ slashify !destdir; !pkgname ] + ) ;; @@ -2445,7 +2486,7 @@ (fun s -> if Sys.file_exists s then Queue.add s meta_files else raise(Arg.Bad (Printf.sprintf "%s: file doesn't exists" s))) - "usage: ocamlfind ocamldoc ..."; + "usage: ocamlfind lint ..."; let error = Queue.fold (fun error file -> diff -Nru findlib-1.7.1/src/findlib/Makefile findlib-1.7.3/src/findlib/Makefile --- findlib-1.7.1/src/findlib/Makefile 2016-11-18 13:04:46.000000000 +0000 +++ findlib-1.7.3/src/findlib/Makefile 2017-06-05 14:32:29.000000000 +0000 @@ -38,12 +38,14 @@ DYNLOAD_XOBJECTS = $(DYNLOAD_OBJECTS:.cmo=.cmx) -all: ocamlfind$(EXEC_SUFFIX) findlib.cma findlib_top.cma topfind num_top.cma \ +all: ocamlfind$(EXEC_SUFFIX) findlib.cma findlib_top.cma topfind $(NUMTOP) \ findlib_dynload.cma opt: ocamlfind_opt$(EXEC_SUFFIX) findlib.cmxa findlib_top.cmxa topfind \ findlib_dynload.cmxa +num-top: num_top.cma + ocamlfind$(EXEC_SUFFIX): findlib.cma $(OCAMLFIND_OBJECTS) $(OCAMLC) $(CUSTOM) -o ocamlfind$(EXEC_SUFFIX) -g findlib.cma unix.cma \ $(OCAMLC_FLAGS) $(OCAMLFIND_OBJECTS) @@ -86,8 +88,8 @@ USE_CYGPATH="$(USE_CYGPATH)"; \ export USE_CYGPATH; \ cat findlib_config.mlp | \ - $(TOP)/tools/patch '@CONFIGFILE@' '$(OCAMLFIND_CONF)' | \ - $(TOP)/tools/patch '@STDLIB@' '$(OCAML_CORE_STDLIB)' | \ + $(SH) $(TOP)/tools/patch '@CONFIGFILE@' '$(OCAMLFIND_CONF)' | \ + $(SH) $(TOP)/tools/patch '@STDLIB@' '$(OCAML_CORE_STDLIB)' | \ sed -e 's;@AUTOLINK@;$(OCAML_AUTOLINK);g' \ -e 's;@SYSTEM@;$(SYSTEM);g' \ >findlib_config.ml @@ -107,7 +109,7 @@ USE_CYGPATH="$(USE_CYGPATH)"; \ export USE_CYGPATH; \ cat topfind_rd$(OCAML_REMOVE_DIRECTORY).p | \ - $(TOP)/tools/patch '@SITELIB@' '$(OCAML_SITELIB)' \ + $(SH) $(TOP)/tools/patch '@SITELIB@' '$(OCAML_SITELIB)' \ >topfind num_top.cma: $(NUMTOP_OBJECTS) @@ -122,7 +124,7 @@ mkdir -p "$(prefix)$(OCAML_SITELIB)/$(NAME)" mkdir -p "$(prefix)$(OCAMLFIND_BIN)" test $(INSTALL_TOPFIND) -eq 0 || cp topfind "$(prefix)$(OCAML_CORE_STDLIB)" - files=`$(TOP)/tools/collect_files $(TOP)/Makefile.config findlib.cmi findlib.mli findlib.cma findlib.cmxa findlib.a findlib.cmxs topfind.cmi topfind.mli fl_package_base.mli fl_package_base.cmi fl_metascanner.mli fl_metascanner.cmi fl_metatoken.cmi findlib_top.cma findlib_top.cmxa findlib_top.a findlib_top.cmxs findlib_dynload.cma findlib_dynload.cmxa findlib_dynload.a findlib_dynload.cmxs fl_dynload.mli fl_dynload.cmi META` && \ + files=`$(SH) $(TOP)/tools/collect_files $(TOP)/Makefile.config findlib.cmi findlib.mli findlib.cma findlib.cmxa findlib.a findlib.cmxs topfind.cmi topfind.mli fl_package_base.mli fl_package_base.cmi fl_metascanner.mli fl_metascanner.cmi fl_metatoken.cmi findlib_top.cma findlib_top.cmxa findlib_top.a findlib_top.cmxs findlib_dynload.cma findlib_dynload.cmxa findlib_dynload.a findlib_dynload.cmxs fl_dynload.mli fl_dynload.cmi META` && \ cp $$files "$(prefix)$(OCAML_SITELIB)/$(NAME)" f="ocamlfind$(EXEC_SUFFIX)"; { test -f ocamlfind_opt$(EXEC_SUFFIX) && f="ocamlfind_opt$(EXEC_SUFFIX)"; }; \ cp $$f "$(prefix)$(OCAMLFIND_BIN)/ocamlfind$(EXEC_SUFFIX)" diff -Nru findlib-1.7.1/src/findlib/META.in findlib-1.7.3/src/findlib/META.in --- findlib-1.7.1/src/findlib/META.in 2016-11-18 13:04:46.000000000 +0000 +++ findlib-1.7.3/src/findlib/META.in 2017-06-05 14:32:29.000000000 +0000 @@ -1,13 +1,19 @@ # specifications for "findlib": description = "Package manager" -requires = "" +requires = "findlib.internal" +requires(toploop) += "findlib.top" +requires(create_toploop) += "findlib.top" version = "@VERSION@" -archive(byte) = "findlib.cma" -archive(byte,toploop) = "findlib.cma findlib_top.cma" -archive(byte,create_toploop) = "findlib.cma findlib_top.cma" -archive(native) = "findlib.cmxa" -plugin(byte) = "findlib.cma" -plugin(native) = "findlib.cmxs" + +package "internal" ( + version = "@VERSION@" + description = "Package manager" + requires = "" + archive(byte) = "findlib.cma" + archive(native) = "findlib.cmxa" + plugin(byte) = "findlib.cma" + plugin(native) = "findlib.cmxs" +) package "dynload" ( version = "@VERSION@" @@ -20,3 +26,10 @@ plugin(native) = "findlib_dynload.cmxs" linkopts = "-linkall" ) + +package "top" ( + version = "@VERSION@" + description = "Package manager toplevel support" + requires = "findlib.internal" + archive(byte) = "findlib_top.cma" +)