From e3605759d78d332031c0034b30424d0ff9b02022 Mon Sep 17 00:00:00 2001 From: Peter Lemenkov Date: Jan 10 2017 16:27:23 +0000 Subject: Ver. 1.0.4 Signed-off-by: Peter Lemenkov --- diff --git a/.gitignore b/.gitignore index d1a1208..b569d87 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /basho-basho_stats-1.0.2-0-gbe9a054.tar.gz /basho-basho_stats-1.0.3-0-g19c532a.tar.gz /basho_stats-1.0.3.tar.gz +/basho_stats-1.0.4.tar.gz diff --git a/erlang-basho_stats-0001-Use-rand-instead-of-deprecated-random-module.patch b/erlang-basho_stats-0001-Use-rand-instead-of-deprecated-random-module.patch new file mode 100644 index 0000000..47b1cc8 --- /dev/null +++ b/erlang-basho_stats-0001-Use-rand-instead-of-deprecated-random-module.patch @@ -0,0 +1,63 @@ +From: Peter Lemenkov +Date: Tue, 10 Jan 2017 19:24:06 +0300 +Subject: [PATCH] Use rand instead of deprecated random module + +Signed-off-by: Peter Lemenkov + +diff --git a/rebar.config b/rebar.config +index 019a955..0bab00c 100644 +--- a/rebar.config ++++ b/rebar.config +@@ -1,5 +1,4 @@ + {deps, [ +- {rand_compat, "1.1", {git, "https://github.com/basho/erlang-rand-compat.git", {tag, "v1.1"}}} + ]}. + + {cover_enabled, true}. +diff --git a/src/basho_stats_rv.erl b/src/basho_stats_rv.erl +index 7cebc94..598baa1 100644 +--- a/src/basho_stats_rv.erl ++++ b/src/basho_stats_rv.erl +@@ -29,7 +29,6 @@ + -on_load(init/0). + + init() -> +- rand_compat:init(), + ok. + + %% ==================================================================== +@@ -40,13 +39,13 @@ init() -> + %% Generates a uniformly-distributed random variable (wrapper for convenience) + %% + uniform() -> +- rnd:uniform(). ++ rand:uniform(). + + %% + %% Generates an exponential-distributed random variable, using inverse function + %% + exponential(Lambda) -> +- -math:log(rnd:uniform()) / Lambda. ++ -math:log(rand:uniform()) / Lambda. + + %% + %% Generates a Poisson-distributed random variable by summing exponential rvs +@@ -59,8 +58,8 @@ poisson(Lambda) -> + %% Generates a Normal-distributed random variable, using Box-Muller method + %% + normal(Mean, Sigma) -> +- Rv1 = rnd:uniform(), +- Rv2 = rnd:uniform(), ++ Rv1 = rand:uniform(), ++ Rv2 = rand:uniform(), + Rho = math:sqrt(-2 * math:log(1-Rv2)), + Rho * math:cos(2 * math:pi() * Rv1) * Sigma + Mean. + +@@ -70,6 +69,6 @@ normal(Mean, Sigma) -> + %% ==================================================================== + + poisson_rv_loop(Lambda, Sum, N) when Sum < Lambda -> +- poisson_rv_loop(Lambda, Sum - math:log(rnd:uniform()), N+1); ++ poisson_rv_loop(Lambda, Sum - math:log(rand:uniform()), N+1); + poisson_rv_loop(_Lambda, _Sum, N) -> + N. diff --git a/erlang-basho_stats.spec b/erlang-basho_stats.spec index 6981e29..58c82cf 100644 --- a/erlang-basho_stats.spec +++ b/erlang-basho_stats.spec @@ -10,8 +10,8 @@ Name: erlang-%{realname} -Version: 1.0.3 -Release: 7%{?dist} +Version: 1.0.4 +Release: 1%{?dist} Summary: Basic Erlang statistics library Group: Development/Languages License: ASL 2.0 @@ -20,6 +20,7 @@ URL: https://github.com/%{upstream}/%{realname} VCS: scm:git:https://github.com/%{upstream}/%{realname}.git %endif Source0: https://github.com/%{upstream}/%{realname}/archive/%{version}/%{realname}-%{version}.tar.gz +Patch1: erlang-basho_stats-0001-Use-rand-instead-of-deprecated-random-module.patch BuildRequires: erlang-rebar @@ -29,6 +30,7 @@ Basic Erlang statistics library. %prep %setup -q -n %{realname}-%{version} +%patch1 -p1 %build @@ -48,6 +50,9 @@ Basic Erlang statistics library. %changelog +* Tue Jan 10 2017 Peter Lemenkov - 1.0.4-1 +- Ver. 1.0.4 + * Wed Jun 1 2016 Peter Lemenkov - 1.0.3-7 - Spec-file cleanups diff --git a/sources b/sources index c496db2..cd8ccc4 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -5a1cd2a09fc8d459588184fefe4e74f3 basho_stats-1.0.3.tar.gz +SHA512 (basho_stats-1.0.4.tar.gz) = 36d8ba6f74f7fcb1ceecf316aa950c31070fa8c74fdae899dd6535efde81bceadd447595fb096edfb57c55ab7ffa96f6fac88b94004dd685cadb70fcfaaac270