From e4cc04ad4af3ecfe40408414929a3a2cbdf7ef37 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 9 Sep 2014 17:41:34 +0100 Subject: [PATCH] Fix bug in argument parsing (RHBZ#1139790). --- ...g-Add-no_arg-and-get_arg-helper-functions.patch | 4 ++-- ...lags-such-as-flag-arg-as-well-as-flag-arg.patch | 14 ++++++++------ ...-ISO-C99-types-u-int-32-64-_t-in-preferen.patch | 2 +- ocaml.spec | 5 ++++- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/0009-arg-Add-no_arg-and-get_arg-helper-functions.patch b/0009-arg-Add-no_arg-and-get_arg-helper-functions.patch index 3a5d1d6..8d300c1 100644 --- a/0009-arg-Add-no_arg-and-get_arg-helper-functions.patch +++ b/0009-arg-Add-no_arg-and-get_arg-helper-functions.patch @@ -1,4 +1,4 @@ -From 9e70610b08939bef354be508eb8eec6a498ec663 Mon Sep 17 00:00:00 2001 +From 0641f11626be99c8bde349520ac28a8d93106856 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 1 Apr 2014 11:17:07 +0100 Subject: [PATCH 09/11] arg: Add no_arg and get_arg helper functions. @@ -6,7 +6,7 @@ Subject: [PATCH 09/11] arg: Add no_arg and get_arg helper functions. The no_arg function in this patch is a no-op. It will do something useful in the followups. -The get_arg function simple checks the next position on the command +The get_arg function simply checks the next position on the command line exists and returns that argument or raises a Arg.Missing. This patch should introduce no functional change, it is simply code diff --git a/0010-arg-Allow-flags-such-as-flag-arg-as-well-as-flag-arg.patch b/0010-arg-Allow-flags-such-as-flag-arg-as-well-as-flag-arg.patch index 6b4436f..d33a771 100644 --- a/0010-arg-Allow-flags-such-as-flag-arg-as-well-as-flag-arg.patch +++ b/0010-arg-Allow-flags-such-as-flag-arg-as-well-as-flag-arg.patch @@ -1,4 +1,4 @@ -From 40e1fd09162cccabe79013c9f663c1b970dee771 Mon Sep 17 00:00:00 2001 +From 4d1defe6f017b86b0766fd02005a468bedd9aa88 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 1 Apr 2014 11:21:40 +0100 Subject: [PATCH 10/11] arg: Allow flags such as --flag=arg as well as --flag @@ -11,12 +11,12 @@ command line parsing libraries allow. Fix for the following issue: http://caml.inria.fr/mantis/view.php?id=5197 --- - stdlib/arg.ml | 28 ++++++++++++++++++++++------ + stdlib/arg.ml | 30 ++++++++++++++++++++++++------ stdlib/arg.mli | 3 ++- - 2 files changed, 24 insertions(+), 7 deletions(-) + 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/stdlib/arg.ml b/stdlib/arg.ml -index a41e0a2..88b1306 100644 +index a41e0a2..5ffdabc 100644 --- a/stdlib/arg.ml +++ b/stdlib/arg.ml @@ -55,6 +55,12 @@ let rec assoc3 x l = @@ -32,7 +32,7 @@ index a41e0a2..88b1306 100644 let make_symlist prefix sep suffix l = match l with | [] -> "" -@@ -130,14 +136,24 @@ let parse_argv_dynamic ?(current=current) argv speclist anonfun errmsg = +@@ -130,14 +136,26 @@ let parse_argv_dynamic ?(current=current) argv speclist anonfun errmsg = while !current < l do let s = argv.(!current) in if String.length s >= 1 && s.[0] = '-' then begin @@ -59,7 +59,9 @@ index a41e0a2..88b1306 100644 + | None -> + if !current + 1 < l then argv.(!current + 1) + else stop (Missing s) -+ | Some arg -> arg ++ | Some arg -> ++ decr current; ++ arg in begin try let rec treat_action = function diff --git a/0011-PR-6517-use-ISO-C99-types-u-int-32-64-_t-in-preferen.patch b/0011-PR-6517-use-ISO-C99-types-u-int-32-64-_t-in-preferen.patch index ee4c3db..b19149c 100644 --- a/0011-PR-6517-use-ISO-C99-types-u-int-32-64-_t-in-preferen.patch +++ b/0011-PR-6517-use-ISO-C99-types-u-int-32-64-_t-in-preferen.patch @@ -1,4 +1,4 @@ -From 2c490afbb343fb84930890ec552b876e6481cf0a Mon Sep 17 00:00:00 2001 +From 6156d208e6cc6e28a964be5dd34585bd54f6eadf Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Wed, 27 Aug 2014 09:58:33 +0000 Subject: [PATCH 11/11] PR#6517: use ISO C99 types {,u}int{32,64}_t in diff --git a/ocaml.spec b/ocaml.spec index fdea837..c9dea4e 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -17,7 +17,7 @@ Name: ocaml Version: 4.02.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: OCaml compiler and programming environment @@ -418,6 +418,9 @@ fi %changelog +* Tue Sep 9 2014 Richard W.M. Jones - 4.02.0-2 +- Fix bug in argument parsing (RHBZ#1139790). + * Sat Aug 30 2014 Richard W.M. Jones - 4.02.0-1 - New upstream OCaml 4.02.0 final. - Add patch for ocaml-camlimages