Fixes for version 0.5.2.

This commit is contained in:
Richard W.M. Jones 2017-11-08 17:38:59 +00:00
parent a9e8600c63
commit 1f1fd12874
2 changed files with 32 additions and 7 deletions

View File

@ -0,0 +1,20 @@
--- ocaml-fileutils-0.5.2.old/src/FileUtilCP.ml 2017-05-23 21:12:19.000000000 +0100
+++ ocaml-fileutils-0.5.2/src/FileUtilCP.ml 2017-11-08 17:36:42.271524209 +0000
@@ -138,7 +138,7 @@
end
in
- let buffer = String.make 1024 ' ' in
+ let buffer = Bytes.make 1024 ' ' in
let cp_file st_src dst_exists fn_src fn_dst =
let mode = int_of_permission st_src.permission in
@@ -176,7 +176,7 @@
try
while (read :=
handle_exception
- (Unix.read fd_src buffer 0) (String.length buffer)
+ (Unix.read fd_src buffer 0) (Bytes.length buffer)
(fun e -> `ErrorRead(fn_src, e));
!read <> 0) do
let written =

View File

@ -7,6 +7,8 @@ License: LGPLv2 with exceptions
URL: https://forge.ocamlcore.org/projects/ocaml-fileutils/ URL: https://forge.ocamlcore.org/projects/ocaml-fileutils/
Source0: http://forge.ocamlcore.org/frs/download.php/1695/ocaml-fileutils-0.5.2.tar.gz Source0: http://forge.ocamlcore.org/frs/download.php/1695/ocaml-fileutils-0.5.2.tar.gz
Patch1: fileutils-0.5.2-fix-bytes.patch
BuildRequires: ocaml >= 4.00.1 BuildRequires: ocaml >= 4.00.1
BuildRequires: ocaml-findlib-devel >= 1.3.3-3 BuildRequires: ocaml-findlib-devel >= 1.3.3-3
BuildRequires: ocaml-ocamldoc BuildRequires: ocaml-ocamldoc
@ -39,16 +41,17 @@ developing applications that use %{name}.
%prep %prep
%setup -q %setup -q
%autopatch -p1
# Disable the tests (RHEL 7 only) since they require ocaml-ounit.
%if 0%{?rhel} >= 7
rm test/test.ml
touch test/test.ml
%endif
%build %build
ocaml setup.ml -configure --prefix %{_prefix} --destdir $RPM_BUILD_ROOT # Disable the tests (RHEL 7 only) since they require ocaml-ounit.
ocaml setup.ml -configure --prefix %{_prefix} --destdir $RPM_BUILD_ROOT \
%if 0%{?rhel} >= 7
--disable-tests
%else
--enable-tests
%endif
make make
@ -63,7 +66,9 @@ make htmldir=. install
%check %check
%if ! 0%{?rhel} >= 7
make test make test
%endif
%files %files