diff --git a/0.14.0.tar.gz b/0.14.0.tar.gz new file mode 100644 index 0000000..4a93b84 Binary files /dev/null and b/0.14.0.tar.gz differ diff --git a/erlang-erlydtl-0006-Support-Erlang-OTP-20.0.patch b/erlang-erlydtl-0006-Support-Erlang-OTP-20.0.patch deleted file mode 100644 index 703435f..0000000 --- a/erlang-erlydtl-0006-Support-Erlang-OTP-20.0.patch +++ /dev/null @@ -1,31 +0,0 @@ -From: Dmitry Klionsky -Date: Tue, 27 Jun 2017 17:41:18 +0300 -Subject: [PATCH] Support Erlang/OTP 20.0 - - -diff --git a/.travis.yml b/.travis.yml -index d1e5019..d50acb2 100644 ---- a/.travis.yml -+++ b/.travis.yml -@@ -2,6 +2,8 @@ language: erlang - sudo: false - otp_release: - # Test on all supported releases accepted by the `require_otp_vsn` in rebar.config -+ - 20.0 -+ - 19.3 - - 18.0 - - 17.4 - - 17.3 -diff --git a/rebar.config b/rebar.config -index 3ac7c11..4680515 100644 ---- a/rebar.config -+++ b/rebar.config -@@ -2,7 +2,7 @@ - - %% accept R15B02.., any R16B except R16B03 - %% also accept OTP v17, altough it may not work properly on that release yet.. --{require_otp_vsn, "R15B0[^1]|R16B$|R16B[^0]|R16B0[^3]|R16B03-1|17|18|19"}. -+{require_otp_vsn, "R15B0[^1]|R16B$|R16B[^0]|R16B0[^3]|R16B03-1|17|18|19|20"}. - - {erl_opts, [debug_info]}. - {yrl_opts, [{includefile, "include/erlydtl_preparser.hrl"}]}. diff --git a/erlang-erlydtl-0007-compatibility-with-OTP-21.patch b/erlang-erlydtl-0007-compatibility-with-OTP-21.patch deleted file mode 100644 index 56f9611..0000000 --- a/erlang-erlydtl-0007-compatibility-with-OTP-21.patch +++ /dev/null @@ -1,58 +0,0 @@ -From: brigadier -Date: Fri, 17 Aug 2018 00:38:56 +0300 -Subject: [PATCH] compatibility with OTP 21 - - -diff --git a/rebar.config b/rebar.config -index 4680515..8712dfa 100644 ---- a/rebar.config -+++ b/rebar.config -@@ -2,7 +2,7 @@ - - %% accept R15B02.., any R16B except R16B03 - %% also accept OTP v17, altough it may not work properly on that release yet.. --{require_otp_vsn, "R15B0[^1]|R16B$|R16B[^0]|R16B0[^3]|R16B03-1|17|18|19|20"}. -+{require_otp_vsn, "R15B0[^1]|R16B$|R16B[^0]|R16B0[^3]|R16B03-1|17|18|19|20|21"}. - - {erl_opts, [debug_info]}. - {yrl_opts, [{includefile, "include/erlydtl_preparser.hrl"}]}. -diff --git a/src/erlydtl_filters.erl b/src/erlydtl_filters.erl -index 3fe1be3..43eeae8 100644 ---- a/src/erlydtl_filters.erl -+++ b/src/erlydtl_filters.erl -@@ -355,10 +355,10 @@ floatformat(_, _) -> "". - floatformat_io(Number, []) -> - floatformat_io(Number, -1); - floatformat_io(Number, 0) -> -- hd(io_lib:format("~B", [erlang:round(Number)])); -+ lists:flatten(io_lib:format("~B", [erlang:round(Number)])); - floatformat_io(Number, Precision) when Precision > 0 -> -- hd(io_lib:format("~.*f",[Precision, Number])); --floatformat_io(Number, Precision) when Precision < 0 -> -+ lists:flatten(io_lib:format("~.*f",[Precision, Number])); -+floatformat_io(Number, Precision) when Precision < 0 -> - Round = erlang:round(Number), - RoundPrecision = round(Number, -Precision), - if RoundPrecision == Round -> -@@ -590,11 +590,12 @@ stringformat(Input, Conversion) when is_binary(Conversion) -> - stringformat(Input, unicode:characters_to_list(Conversion)); - stringformat(Input, Conversion) -> - ParsedConversion = re:replace(Conversion, "([\-#\+ ]?)([0-9\*]+)?(\.?)([0-9]?)([diouxXeEfFgGcrs])", "\\1 ,\\2 ,\\3 ,\\4 ,\\5 ", [{return,list}]), -+ - ?debugFmt("ParsedConversion: ~p~n", [ParsedConversion]), - ParsedConversion1 = lists:map(fun(X) -> string:strip(X) end, string:tokens(ParsedConversion, ",")), - [ConversionFlag, MinFieldWidth, Precision, PrecisionLength, ConversionType] = ParsedConversion1, - ?debugFmt("ConversionFlag, MinFieldWidth, Precision, PrecisionLength, ConversionType: ~p, ~p, ~p, ~p, ~p ~n", [ConversionFlag, cast_to_integer(MinFieldWidth), Precision, cast_to_integer(PrecisionLength), ConversionType]), -- [String] = stringformat_io(Input, Conversion, ConversionFlag, cast_to_integer(MinFieldWidth), Precision, cast_to_integer(PrecisionLength), ConversionType), -+ String = stringformat_io(Input, Conversion, ConversionFlag, cast_to_integer(MinFieldWidth), Precision, cast_to_integer(PrecisionLength), ConversionType), - lists:flatten(String). - - %% @doc -@@ -640,6 +641,7 @@ stringformat_io(Input, Conversion, _ConversionFlag, _MinFieldWidth, - io_lib:format(Format, [cast_to_float(Input)]); - stringformat_io(Input, Conversion, _ConversionFlag, _MinFieldWidth, - [], [], "d")-> -+ - %?debugMsg("plain d"), - %Conversion = [ConversionFlag, MinFieldWidth, Precision, PrecisionLength, ConversionType], - Format = "~" ++ re:replace(Conversion, "d", "B", [{return, list}] ), diff --git a/erlang-erlydtl-0008-merl-bug-in-OTP-21-workaround.patch b/erlang-erlydtl-0008-merl-bug-in-OTP-21-workaround.patch deleted file mode 100644 index 2d35b18..0000000 --- a/erlang-erlydtl-0008-merl-bug-in-OTP-21-workaround.patch +++ /dev/null @@ -1,42 +0,0 @@ -From: brigadier -Date: Sat, 18 Aug 2018 18:55:19 +0300 -Subject: [PATCH] merl bug in OTP 21 workaround - - -diff --git a/src/erlydtl_beam_compiler.erl b/src/erlydtl_beam_compiler.erl -index 7ab3aa8..c7b149a 100644 ---- a/src/erlydtl_beam_compiler.erl -+++ b/src/erlydtl_beam_compiler.erl -@@ -861,8 +861,9 @@ blocktrans_ast(Args, Contents, PluralContents, TreeWalker) -> - Body -> - {ok, DjangoParseTree} = do_parse_template(Body, TreeWalkerAcc#treewalker.context), - {{BodyAst, BodyInfo}, BodyTreeWalker} = body_ast(DjangoParseTree, TreeWalkerAcc), -+ Clause = erl_syntax:clause([erl_syntax:abstract(Locale)], none, [BodyAst]), - {merge_info(BodyInfo, AstInfoAcc), BodyTreeWalker, -- [?Q("_@Locale@ -> _@BodyAst")|ClauseAcc]} -+ [Clause | ClauseAcc]} - end - end, - {MergedInfo, TreeWalker3, []}, TLocales), -@@ -975,14 +976,15 @@ compiletime_trans_ast(TFun, Text, LContext, - }=TreeWalker) -> - ClAst = lists:foldl( - fun(Locale, ClausesAcc) -> -- [?Q("_@Locale@ -> _@translated", -- [{translated, case TFun(Text, phrase_locale(Locale, LContext)) of -- default -> string_ast(Text, Context); -- Translated -> string_ast(Translated, Context) -- end}]) -- |ClausesAcc] -+ BodyAst = case TFun(Text, phrase_locale(Locale, LContext)) of -+ default -> string_ast(Text, Context); -+ Translated -> string_ast(Translated, Context) -+ end, -+ Clause = erl_syntax:clause([erl_syntax:abstract(Locale)], none, [BodyAst]), -+ [Clause | ClausesAcc] - end, - [], TLocales), -+ - {{?Q(["case _CurrentLocale of", - " _@_ClAst -> _;", - " _ -> _@string", diff --git a/erlang-erlydtl-0009-Make-sure-that-when-checking-if-a-function-is-export.patch b/erlang-erlydtl-0009-Make-sure-that-when-checking-if-a-function-is-export.patch deleted file mode 100644 index 859f918..0000000 --- a/erlang-erlydtl-0009-Make-sure-that-when-checking-if-a-function-is-export.patch +++ /dev/null @@ -1,18 +0,0 @@ -From: Seb Maynard -Date: Thu, 24 Jan 2019 14:47:14 +0000 -Subject: [PATCH] Make sure that when checking if a function is exported that - the module in question is loaded by the code server - - -diff --git a/src/erlydtl_runtime.erl b/src/erlydtl_runtime.erl -index fad5872..e7efcc8 100644 ---- a/src/erlydtl_runtime.erl -+++ b/src/erlydtl_runtime.erl -@@ -472,6 +472,7 @@ read_file(Module, Function, DocRoot, FileName, ReaderOptions) -> - throw({read_file, AbsName, Reason}) - end. - read_file_internal(Module, Function, FileName, ReaderOptions) -> -+ _ = code:ensure_loaded(Module), - case erlang:function_exported(Module, Function,1) of - true -> - Module:Function(FileName); diff --git a/erlang-erlydtl-0010-Support-Erlang-OTP-22.0.patch b/erlang-erlydtl-0010-Support-Erlang-OTP-22.0.patch deleted file mode 100644 index f79f5ce..0000000 --- a/erlang-erlydtl-0010-Support-Erlang-OTP-22.0.patch +++ /dev/null @@ -1,19 +0,0 @@ -From: Peter Lemenkov -Date: Mon, 11 Nov 2019 00:03:59 +0100 -Subject: [PATCH] Support Erlang/OTP 22.0 - -Signed-off-by: Peter Lemenkov - -diff --git a/rebar.config b/rebar.config -index 8712dfa..ea35569 100644 ---- a/rebar.config -+++ b/rebar.config -@@ -2,7 +2,7 @@ - - %% accept R15B02.., any R16B except R16B03 - %% also accept OTP v17, altough it may not work properly on that release yet.. --{require_otp_vsn, "R15B0[^1]|R16B$|R16B[^0]|R16B0[^3]|R16B03-1|17|18|19|20|21"}. -+{require_otp_vsn, "R15B0[^1]|R16B$|R16B[^0]|R16B0[^3]|R16B03-1|17|18|19|20|21|22"}. - - {erl_opts, [debug_info]}. - {yrl_opts, [{includefile, "include/erlydtl_preparser.hrl"}]}. diff --git a/erlang-erlydtl.spec b/erlang-erlydtl.spec index 36e91c5..6625688 100644 --- a/erlang-erlydtl.spec +++ b/erlang-erlydtl.spec @@ -1,50 +1,56 @@ %global realname erlydtl %global upstream erlydtl -Name: erlang-%{realname} -Version: 0.12.1 -Release: 1 -BuildArch: noarch -Summary: Erlang implementation of the Django Template Language -License: MIT -URL: https://github.com/%{upstream}/%{realname} -VCS: scm:git:https://github.com/%{upstream}/%{realname}.git -Source0: https://github.com/%{upstream}/%{realname}/archive/%{version}/%{realname}-%{version}.tar.gz -Patch1: erlang-erlydtl-0001-Verbose-testing.patch -Patch2: erlang-erlydtl-0002-No-such-function-exported-gettext_compile-write_pret.patch -Patch3: erlang-erlydtl-0003-No-such-function-exported-gettext_compile-fmt_filein.patch -Patch4: erlang-erlydtl-0004-No-such-fun-gettext_compile-open_po_file-3.patch -Patch5: erlang-erlydtl-0005-No-such-fun-gettext_compile-close_file-0.patch -Patch6: erlang-erlydtl-0006-Support-Erlang-OTP-20.0.patch -Patch7: erlang-erlydtl-0007-compatibility-with-OTP-21.patch -Patch8: erlang-erlydtl-0008-merl-bug-in-OTP-21-workaround.patch -Patch9: erlang-erlydtl-0009-Make-sure-that-when-checking-if-a-function-is-export.patch -Patch10: erlang-erlydtl-0010-Support-Erlang-OTP-22.0.patch -Provides: ErlyDTL = %{version}-%{release} -BuildRequires: erlang-rebar +Name: erlang-%{realname} +Version: 0.14.0 +Release: 1 +BuildArch: noarch +Summary: Erlang implementation of the Django Template Language +License: MIT and Apache-2..0 +URL: https://github.com/%{upstream}/%{realname} +VCS: scm:git:https://github.com/%{upstream}/%{realname}.git +Source0: https://github.com/%{upstream}/%{realname}/archive/refs/tags/0.14.0.tar.gz +Patch1: erlang-erlydtl-0001-Verbose-testing.patch +Patch2: erlang-erlydtl-0002-No-such-function-exported-gettext_compile-write_pret.patch +Patch3: erlang-erlydtl-0003-No-such-function-exported-gettext_compile-fmt_filein.patch +Patch4: erlang-erlydtl-0004-No-such-fun-gettext_compile-open_po_file-3.patch +Patch5: erlang-erlydtl-0005-No-such-fun-gettext_compile-close_file-0.patch +Provides: ErlyDTL = %{version}-%{release} +BuildRequires: erlang-rebar + + %description ErlyDTL is an Erlang implementation of the Django Template Language. The erlydtl module compiles Django Template source code into Erlang bytecode. The compiled template has a "render" function that takes a list of variables and returns a fully rendered document. + %prep %autosetup -p1 -n %{realname}-%{version} + %build %{erlang_compile} + %install %{erlang_install} cp -arv priv %{buildroot}/%{erlang_appdir}/ + %check %{erlang_test -C rebar-tests.config} + %files %license LICENSE %doc CONTRIBUTING.md NEWS.md README.markdown README_I18N %{erlang_appdir}/ + %changelog -* Sat Aug 29 2020 wangyue - 0.12.1-1 +* Fri Jan 21 2022 Ge Wang - 1.14.0-1 +- update to version 1.14.0 + +* Sat Aug 29 2020 wangyue - 1.12.1-1 - package init diff --git a/erlydtl-0.12.1.tar.gz b/erlydtl-0.12.1.tar.gz deleted file mode 100644 index 5e65b45..0000000 Binary files a/erlydtl-0.12.1.tar.gz and /dev/null differ