mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-20 16:15:59 +01:00
Elixir: Fix Elixir 1.17-dev warnings about single-quoted charlists
This commit is contained in:
parent
8b38aebbc7
commit
852a540cb0
@ -8,6 +8,6 @@ end
|
|||||||
rootpath = System.get_env("RELEASE_ROOT", rootdefault)
|
rootpath = System.get_env("RELEASE_ROOT", rootdefault)
|
||||||
config :ejabberd,
|
config :ejabberd,
|
||||||
file: Path.join(rootpath, "conf/ejabberd.yml"),
|
file: Path.join(rootpath, "conf/ejabberd.yml"),
|
||||||
log_path: Path.join(rootpath, 'logs/ejabberd.log')
|
log_path: Path.join(rootpath, "logs/ejabberd.log")
|
||||||
config :mnesia,
|
config :mnesia,
|
||||||
dir: Path.join(rootpath, 'database/')
|
dir: Path.join(rootpath, "database/")
|
||||||
|
@ -60,7 +60,7 @@ defmodule Ejabberd.Config.EjabberdModule do
|
|||||||
defp fetch_and_store_repo_source_if_not_exists(path, repo) do
|
defp fetch_and_store_repo_source_if_not_exists(path, repo) do
|
||||||
unless File.exists?(path) do
|
unless File.exists?(path) do
|
||||||
IO.puts "[info] Fetching: #{repo}"
|
IO.puts "[info] Fetching: #{repo}"
|
||||||
:os.cmd('git clone #{repo} #{path}')
|
:os.cmd(~c"git clone #{repo} #{path}")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -2,19 +2,19 @@ defmodule ModPresenceDemo do
|
|||||||
use Ejabberd.Module
|
use Ejabberd.Module
|
||||||
|
|
||||||
def start(host, _opts) do
|
def start(host, _opts) do
|
||||||
info('Starting ejabberd module Presence Demo')
|
info("Starting ejabberd module Presence Demo")
|
||||||
Ejabberd.Hooks.add(:set_presence_hook, host, __MODULE__, :on_presence, 50)
|
Ejabberd.Hooks.add(:set_presence_hook, host, __MODULE__, :on_presence, 50)
|
||||||
:ok
|
:ok
|
||||||
end
|
end
|
||||||
|
|
||||||
def stop(host) do
|
def stop(host) do
|
||||||
info('Stopping ejabberd module Presence Demo')
|
info("Stopping ejabberd module Presence Demo")
|
||||||
Ejabberd.Hooks.delete(:set_presence_hook, host, __MODULE__, :on_presence, 50)
|
Ejabberd.Hooks.delete(:set_presence_hook, host, __MODULE__, :on_presence, 50)
|
||||||
:ok
|
:ok
|
||||||
end
|
end
|
||||||
|
|
||||||
def on_presence(user, _server, _resource, _packet) do
|
def on_presence(user, _server, _resource, _packet) do
|
||||||
info('Receive presence for #{user}')
|
info("Receive presence for #{user}")
|
||||||
:none
|
:none
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ defmodule ModPresenceDemo do
|
|||||||
end
|
end
|
||||||
|
|
||||||
def mod_doc() do
|
def mod_doc() do
|
||||||
%{:desc => 'This is just a demonstration.'}
|
%{:desc => "This is just a demonstration."}
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
32
mix.exs
32
mix.exs
@ -23,11 +23,11 @@ defmodule Ejabberd.MixProject do
|
|||||||
def version do
|
def version do
|
||||||
case config(:vsn) do
|
case config(:vsn) do
|
||||||
:false -> "0.0.0" # ./configure wasn't run: vars.config not created
|
:false -> "0.0.0" # ./configure wasn't run: vars.config not created
|
||||||
'0.0' -> "0.0.0" # the full git repository wasn't downloaded
|
~c"0.0" -> "0.0.0" # the full git repository wasn't downloaded
|
||||||
'latest.0' -> "0.0.0" # running 'docker-ejabberd/ecs/build.sh latest'
|
~c"latest.0" -> "0.0.0" # running 'docker-ejabberd/ecs/build.sh latest'
|
||||||
[_, _, ?., _, _] = x ->
|
[_, _, ?., _, _] = x ->
|
||||||
head = String.replace(:erlang.list_to_binary(x), ~r/\.0+([0-9])/, ".\\1")
|
head = String.replace(:erlang.list_to_binary(x), ~r/\.0+([0-9])/, ".\\1")
|
||||||
<<head::binary, ".0">>
|
"#{head}.0"
|
||||||
vsn -> String.replace(:erlang.list_to_binary(vsn), ~r/\.0+([0-9])/, ".\\1")
|
vsn -> String.replace(:erlang.list_to_binary(vsn), ~r/\.0+([0-9])/, ".\\1")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -72,16 +72,16 @@ defmodule Ejabberd.MixProject do
|
|||||||
result = [{:d, :ELIXIR_ENABLED}] ++
|
result = [{:d, :ELIXIR_ENABLED}] ++
|
||||||
cond_options() ++
|
cond_options() ++
|
||||||
Enum.map(includes, fn (path) -> {:i, path} end) ++
|
Enum.map(includes, fn (path) -> {:i, path} end) ++
|
||||||
if_version_above('20', [{:d, :DEPRECATED_GET_STACKTRACE}]) ++
|
if_version_above(~c"20", [{:d, :DEPRECATED_GET_STACKTRACE}]) ++
|
||||||
if_version_above('20', [{:d, :HAVE_URI_STRING}]) ++
|
if_version_above(~c"20", [{:d, :HAVE_URI_STRING}]) ++
|
||||||
if_version_above('20', [{:d, :HAVE_ERL_ERROR}]) ++
|
if_version_above(~c"20", [{:d, :HAVE_ERL_ERROR}]) ++
|
||||||
if_version_below('21', [{:d, :USE_OLD_HTTP_URI}]) ++
|
if_version_below(~c"21", [{:d, :USE_OLD_HTTP_URI}]) ++
|
||||||
if_version_below('22', [{:d, :LAGER}]) ++
|
if_version_below(~c"22", [{:d, :LAGER}]) ++
|
||||||
if_version_below('21', [{:d, :NO_CUSTOMIZE_HOSTNAME_CHECK}]) ++
|
if_version_below(~c"21", [{:d, :NO_CUSTOMIZE_HOSTNAME_CHECK}]) ++
|
||||||
if_version_below('23', [{:d, :USE_OLD_CRYPTO_HMAC}]) ++
|
if_version_below(~c"23", [{:d, :USE_OLD_CRYPTO_HMAC}]) ++
|
||||||
if_version_below('23', [{:d, :USE_OLD_PG2}]) ++
|
if_version_below(~c"23", [{:d, :USE_OLD_PG2}]) ++
|
||||||
if_version_below('24', [{:d, :COMPILER_REPORTS_ONLY_LINES}]) ++
|
if_version_below(~c"24", [{:d, :COMPILER_REPORTS_ONLY_LINES}]) ++
|
||||||
if_version_below('24', [{:d, :SYSTOOLS_APP_DEF_WITHOUT_OPTIONAL}])
|
if_version_below(~c"24", [{:d, :SYSTOOLS_APP_DEF_WITHOUT_OPTIONAL}])
|
||||||
defines = for {:d, value} <- result, do: {:d, value}
|
defines = for {:d, value} <- result, do: {:d, value}
|
||||||
result ++ [{:d, :ALL_DEFS, defines}]
|
result ++ [{:d, :ALL_DEFS, defines}]
|
||||||
end
|
end
|
||||||
@ -136,7 +136,7 @@ defmodule Ejabberd.MixProject do
|
|||||||
{config(:redis), {:eredis, "~> 1.2.0"}},
|
{config(:redis), {:eredis, "~> 1.2.0"}},
|
||||||
{config(:sip), {:esip, "~> 1.0"}},
|
{config(:sip), {:esip, "~> 1.0"}},
|
||||||
{config(:zlib), {:ezlib, "~> 1.0"}},
|
{config(:zlib), {:ezlib, "~> 1.0"}},
|
||||||
{if_version_below('22', true), {:lager, "~> 3.9.1"}},
|
{if_version_below(~c"22", true), {:lager, "~> 3.9.1"}},
|
||||||
{config(:lua), {:luerl, "~> 1.0"}},
|
{config(:lua), {:luerl, "~> 1.0"}},
|
||||||
{config(:mysql), {:p1_mysql, git: "https://github.com/processone/p1_mysql.git", ref: "f685408b910c425b9905d4ddcdbedba717a5b48c"}},
|
{config(:mysql), {:p1_mysql, git: "https://github.com/processone/p1_mysql.git", ref: "f685408b910c425b9905d4ddcdbedba717a5b48c"}},
|
||||||
{config(:pgsql), {:p1_pgsql, "~> 1.1"}},
|
{config(:pgsql), {:p1_pgsql, "~> 1.1"}},
|
||||||
@ -154,7 +154,7 @@ defmodule Ejabberd.MixProject do
|
|||||||
for {:true, app} <- [{config(:pam), :epam},
|
for {:true, app} <- [{config(:pam), :epam},
|
||||||
{config(:lua), :luerl},
|
{config(:lua), :luerl},
|
||||||
{config(:redis), :eredis},
|
{config(:redis), :eredis},
|
||||||
{if_version_below('22', true), :lager},
|
{if_version_below(~c"22", true), :lager},
|
||||||
{config(:mysql), :p1_mysql},
|
{config(:mysql), :p1_mysql},
|
||||||
{config(:sip), :esip},
|
{config(:sip), :esip},
|
||||||
{config(:odbc), :odbc},
|
{config(:odbc), :odbc},
|
||||||
@ -214,7 +214,7 @@ defmodule Ejabberd.MixProject do
|
|||||||
_ -> :ok
|
_ -> :ok
|
||||||
end
|
end
|
||||||
case Version.match?(System.version(), "< 1.11.4")
|
case Version.match?(System.version(), "< 1.11.4")
|
||||||
and :erlang.system_info(:otp_release) > '23' do
|
and :erlang.system_info(:otp_release) > ~c"23" do
|
||||||
true ->
|
true ->
|
||||||
IO.puts("ERROR: To build releases with Elixir lower than 1.11.4, Erlang/OTP lower than 24 is required.")
|
IO.puts("ERROR: To build releases with Elixir lower than 1.11.4, Erlang/OTP lower than 24 is required.")
|
||||||
_ -> :ok
|
_ -> :ok
|
||||||
|
Loading…
Reference in New Issue
Block a user