File 2015-Deprecate-the-random-module.patch of Package erlang
From 61fd09aaef2474cd74ddbc465e9d1dfd879a4ab5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= <bjorn@erlang.org>
Date: Fri, 4 Dec 2015 12:04:12 +0100
Subject: [PATCH 15/15] Deprecate the 'random' module
The 'rand' module was introduced in OTP 18 and its use is
discouraged. Deprecate it to further discourage its use.
---
lib/stdlib/src/otp_internal.erl | 6 ++++++
lib/stdlib/src/random.erl | 1 +
2 files changed, 7 insertions(+)
diff --git a/lib/stdlib/src/otp_internal.erl b/lib/stdlib/src/otp_internal.erl
index 90ef364..166eb3c 100644
--- a/lib/stdlib/src/otp_internal.erl
+++ b/lib/stdlib/src/otp_internal.erl
@@ -639,6 +639,12 @@ obsolete_1(httpd_conf, is_file, 1) ->
obsolete_1(httpd_conf, make_integer, 1) ->
{deprecated, "deprecated; use erlang:list_to_integer/1 instead"};
+%% Added in OTP 19.
+
+obsolete_1(random, _, _) ->
+ {deprecated, "the 'random' module is deprecated; "
+ "use the 'rand' module instead"};
+
obsolete_1(_, _, _) ->
no.
diff --git a/lib/stdlib/src/random.erl b/lib/stdlib/src/random.erl
index 8b67cde..8b639dd 100644
--- a/lib/stdlib/src/random.erl
+++ b/lib/stdlib/src/random.erl
@@ -18,6 +18,7 @@
%% %CopyrightEnd%
%%
-module(random).
+-deprecated(module).
%% Reasonable random number generator.
%% The method is attributed to B. A. Wichmann and I. D. Hill
--
2.1.4