[erlang-getopt] Ver. 0.4.3
Peter Lemenkov
peter at fedoraproject.org
Tue May 15 18:53:29 UTC 2012
commit 8e4262ef081dabb89aada279a9b53e5921fe7649
Author: Peter Lemenkov <lemenkov at gmail.com>
Date: Tue May 15 22:53:20 2012 +0400
Ver. 0.4.3
Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>
.gitignore | 1 +
...-getopt-0001-No-such-type-boolean-in-R12B.patch | 112 +++++++++++++++-----
erlang-getopt.spec | 28 +++--
sources | 2 +-
4 files changed, 104 insertions(+), 39 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 6de6993..0c8e255 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
/jcomellas-getopt-v0.3-0-g8f54692.tar.gz
+/jcomellas-getopt-v0.4.3-0-g659a28f.tar.gz
diff --git a/erlang-getopt-0001-No-such-type-boolean-in-R12B.patch b/erlang-getopt-0001-No-such-type-boolean-in-R12B.patch
index 32456e5..7dab86f 100644
--- a/erlang-getopt-0001-No-such-type-boolean-in-R12B.patch
+++ b/erlang-getopt-0001-No-such-type-boolean-in-R12B.patch
@@ -1,27 +1,62 @@
-From 56adf996e35ec04d950ae18f91660ef04210da69 Mon Sep 17 00:00:00 2001
+From 7e20fa4755eaddc684e72ef29b1c4f21d57f3c70 Mon Sep 17 00:00:00 2001
From: Peter Lemenkov <lemenkov at gmail.com>
-Date: Wed, 6 Oct 2010 12:02:19 +0400
-Subject: [PATCH] No such type - boolean() in R12B
+Date: Tue, 15 May 2012 22:42:30 +0400
+Subject: [PATCH 1/1] No such type - boolean() in R12B
Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>
---
- src/getopt.erl | 14 +++++++-------
- 1 files changed, 7 insertions(+), 7 deletions(-)
+ src/getopt.erl | 33 ++++++++++++++++-----------------
+ 1 file changed, 16 insertions(+), 17 deletions(-)
diff --git a/src/getopt.erl b/src/getopt.erl
-index 25ceab5..0ae1625 100644
+index 175b7a5..b3088a6 100644
--- a/src/getopt.erl
+++ b/src/getopt.erl
-@@ -31,7 +31,7 @@
+@@ -36,9 +36,9 @@
+
+
%% Atom indicating the data type that an argument can be converted to.
- -type arg_type() :: 'atom' | 'binary' | 'boolean' | 'float' | 'integer' | 'string'.
+--type arg_type() :: 'atom' | 'binary' | 'boolean' | 'float' | 'integer' | 'string'.
++-type arg_type() :: 'atom' | 'binary' | 'bool' | 'float' | 'integer' | 'string'.
%% Data type that an argument can be converted to.
--type arg_value() :: atom() | binary() | boolean() | float() | integer() | string().
+-type arg_value() :: atom() | binary() | bool() | float() | integer() | string().
%% Argument specification.
-type arg_spec() :: arg_type() | {arg_type(), arg_value()} | undefined.
%% Option type and optional default argument.
-@@ -311,7 +311,7 @@ to_type(_Type, Arg) ->
+@@ -316,11 +316,11 @@ add_option_with_assigned_arg({Name, _Short, _Long, ArgSpec, _Help}, Arg, OptAcc)
+
+
+ %% @doc Add an option that required an argument but did not have one. Some data
+-%% types (boolean, integer) allow implicit or assumed arguments.
++%% types (bool, integer) allow implicit or assumed arguments.
+ -spec add_option_with_implicit_arg(option_spec(), [option()]) -> [option()].
+ add_option_with_implicit_arg({Name, _Short, _Long, ArgSpec, _Help}, OptAcc) ->
+ case arg_spec_type(ArgSpec) of
+- boolean ->
++ bool ->
+ %% Special case for boolean arguments: if there is no argument we
+ %% set the value to 'true'.
+ [{Name, true} | OptAcc];
+@@ -338,7 +338,7 @@ add_option_with_implicit_arg({Name, _Short, _Long, ArgSpec, _Help}, OptAcc) ->
+ -spec add_option_with_implicit_incrementable_arg(option_spec() | arg_spec(), [option()]) -> [option()].
+ add_option_with_implicit_incrementable_arg({Name, _Short, _Long, ArgSpec, _Help}, OptAcc) ->
+ case arg_spec_type(ArgSpec) of
+- boolean ->
++ bool ->
+ %% Special case for boolean arguments: if there is no argument we
+ %% set the value to 'true'.
+ [{Name, true} | OptAcc];
+@@ -378,7 +378,7 @@ to_type(integer, Arg) ->
+ list_to_integer(Arg);
+ to_type(float, Arg) ->
+ list_to_float(Arg);
+-to_type(boolean, Arg) ->
++to_type(bool, Arg) ->
+ LowerArg = string:to_lower(Arg),
+ case is_arg_true(LowerArg) of
+ true ->
+@@ -395,15 +395,14 @@ to_type(_Type, Arg) ->
Arg.
@@ -30,28 +65,45 @@ index 25ceab5..0ae1625 100644
is_arg_true(Arg) ->
(Arg =:= "true") orelse (Arg =:= "t") orelse
(Arg =:= "yes") orelse (Arg =:= "y") orelse
-@@ -319,7 +319,7 @@ is_arg_true(Arg) ->
+ (Arg =:= "on") orelse (Arg =:= "enabled") orelse
(Arg =:= "1").
-
+-
--spec is_arg_false(string()) -> boolean().
+-spec is_arg_false(string()) -> bool().
is_arg_false(Arg) ->
(Arg =:= "false") orelse (Arg =:= "f") orelse
(Arg =:= "no") orelse (Arg =:= "n") orelse
-@@ -327,7 +327,7 @@ is_arg_false(Arg) ->
+@@ -411,10 +410,10 @@ is_arg_false(Arg) ->
(Arg =:= "0").
---spec is_valid_arg(arg_spec() | arg_type(), string()) -> boolean().
-+-spec is_valid_arg(arg_spec() | arg_type(), string()) -> bool().
+--spec is_valid_arg(arg_spec(), nonempty_string()) -> boolean().
++-spec is_valid_arg(arg_spec(), nonempty_string()) -> bool().
is_valid_arg({Type, _DefaultArg}, Arg) ->
is_valid_arg(Type, Arg);
- is_valid_arg(boolean, Arg) ->
-@@ -340,13 +340,13 @@ is_valid_arg(_Type, _Arg) ->
+-is_valid_arg(boolean, Arg) ->
++is_valid_arg(bool, Arg) ->
+ is_boolean_arg(Arg);
+ is_valid_arg(integer, Arg) ->
+ is_non_neg_integer_arg(Arg);
+@@ -424,10 +423,10 @@ is_valid_arg(_Type, _Arg) ->
true.
+--spec is_implicit_arg(arg_spec(), nonempty_string()) -> boolean().
++-spec is_implicit_arg(arg_spec(), nonempty_string()) -> bool().
+ is_implicit_arg({Type, _DefaultArg}, Arg) ->
+ is_implicit_arg(Type, Arg);
+-is_implicit_arg(boolean, Arg) ->
++is_implicit_arg(bool, Arg) ->
+ not is_boolean_arg(Arg);
+ is_implicit_arg(integer, Arg) ->
+ not is_integer_arg(Arg);
+@@ -435,20 +434,20 @@ is_implicit_arg(_Type, _Arg) ->
+ false.
+
+
--spec is_boolean_arg(string()) -> boolean().
+-spec is_boolean_arg(string()) -> bool().
is_boolean_arg(Arg) ->
@@ -61,18 +113,26 @@ index 25ceab5..0ae1625 100644
--spec is_integer_arg(string()) -> boolean().
+-spec is_integer_arg(string()) -> bool().
- is_integer_arg([Head | Tail]) when Head >= $0, Head =< $9 ->
- is_integer_arg(Tail);
- is_integer_arg([_Head | _Tail]) ->
-@@ -355,7 +355,7 @@ is_integer_arg([]) ->
+ is_integer_arg("-" ++ Tail) ->
+ is_non_neg_integer_arg(Tail);
+ is_integer_arg(Arg) ->
+ is_non_neg_integer_arg(Arg).
+
+
+--spec is_non_neg_integer_arg(string()) -> boolean().
++-spec is_non_neg_integer_arg(string()) -> bool().
+ is_non_neg_integer_arg([Head | Tail]) when Head >= $0, Head =< $9 ->
+ is_non_neg_integer_arg(Tail);
+ is_non_neg_integer_arg([_Head | _Tail]) ->
+@@ -457,7 +456,7 @@ is_non_neg_integer_arg([]) ->
true.
---spec is_float_arg(string()) -> boolean().
-+-spec is_float_arg(string()) -> bool().
- is_float_arg([Head | Tail]) when (Head >= $0 andalso Head =< $9) orelse Head =:= $. ->
- is_float_arg(Tail);
- is_float_arg([_Head | _Tail]) ->
+--spec is_non_neg_float_arg(string()) -> boolean().
++-spec is_non_neg_float_arg(string()) -> bool().
+ is_non_neg_float_arg([Head | Tail]) when (Head >= $0 andalso Head =< $9) orelse Head =:= $. ->
+ is_non_neg_float_arg(Tail);
+ is_non_neg_float_arg([_Head | _Tail]) ->
--
-1.7.2.3
+1.7.10.1
diff --git a/erlang-getopt.spec b/erlang-getopt.spec
index 5af0255..8e84722 100644
--- a/erlang-getopt.spec
+++ b/erlang-getopt.spec
@@ -1,25 +1,27 @@
%global realname getopt
+%global upstream jcomellas
%global debug_package %{nil}
-%global git_tag 8f54692
+%global git_tag 659a28f
+%global patchnumber 0
Name: erlang-%{realname}
-Version: 0.3
-Release: 5%{?dist}
+Version: 0.4.3
+Release: 1%{?dist}
Summary: Erlang module to parse command line arguments using the GNU getopt syntax
Group: Development/Libraries
License: BSD
URL: http://github.com/jcomellas/getopt
-# wget http://github.com/jcomellas/getopt/tarball/v0.3
-Source0: jcomellas-%{realname}-v%{version}-0-g%{git_tag}.tar.gz
+# wget --no-check-certificate --content-disposition https://github.com/jcomellas/getopt/tarball/v0.4.3
+Source0: %{upstream}-%{realname}-v%{version}-%{patchnumber}-g%{git_tag}.tar.gz
Patch1: erlang-getopt-0001-No-such-type-boolean-in-R12B.patch
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires: erlang-erts
-#BuildRequires: erlang-rebar
-Requires: erlang-erts >= R12B-5
-Requires: erlang-kernel >= R12B-5
+BuildRequires: erlang-rebar
+# Error:erlang(lists:keyfind/3) - in R12B
+Requires: erlang-erts >= R13B
Requires: erlang-stdlib >= R12B-5
@@ -27,7 +29,7 @@ Requires: erlang-stdlib >= R12B-5
Command-line parsing module that uses a syntax similar to that of GNU getopt.
%prep
-%setup -q -n jcomellas-%{realname}-8f54692
+%setup -q -n %{upstream}-%{realname}-%{git_tag}
%if 0%{?el5}
%patch1 -p1 -b .unknown_type_boolean
%endif
@@ -35,8 +37,7 @@ chmod 0644 examples/*.escript
%build
-#make %{?_smp_mflags}
-erlc -o ebin src/%{realname}.erl
+make %{?_smp_mflags}
%check
@@ -55,7 +56,7 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
-%doc LICENSE.txt README.markdown examples/
+%doc LICENSE.txt README.md examples/
%dir %{_libdir}/erlang/lib/%{realname}-%{version}
%dir %{_libdir}/erlang/lib/%{realname}-%{version}/ebin
%{_libdir}/erlang/lib/%{realname}-%{version}/ebin/%{realname}.app
@@ -63,6 +64,9 @@ rm -rf $RPM_BUILD_ROOT
%changelog
+* Tue May 15 2012 Peter Lemenkov <lemenkov at gmail.com> - 0.4.3-1
+- Ver. 0.4.3
+
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.3-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
diff --git a/sources b/sources
index 1c76783..20a6044 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-1657e6c5d68889befcbae30cd8df805d jcomellas-getopt-v0.3-0-g8f54692.tar.gz
+9562005ca3bd7422cc27233370fad48e jcomellas-getopt-v0.4.3-0-g659a28f.tar.gz
More information about the scm-commits
mailing list