[erlang-rebar] Rebar ver. 2.1.0-pre

Peter Lemenkov peter at fedoraproject.org
Sat Mar 2 09:56:28 UTC 2013


commit ccc495bdd89bd5d099723dc3a13105e50cd78172
Author: Peter Lemenkov <lemenkov at gmail.com>
Date:   Sat Mar 2 13:56:21 2013 +0400

    Rebar ver. 2.1.0-pre
    
    Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>

 .gitignore                                         |    1 +
 erlang-rebar.spec                                  |  140 ++++++++-----------
 ...create-bundle-and-don-t-try-to-load-anyth.patch |  136 +++++++-----------
 rebar-0002-Remove-bundled-mustache.patch           |   56 ++++----
 rebar-0003-Remove-bundled-getopt.patch             |   10 +-
 rebar-0004-Allow-discarding-building-ports.patch   |   38 +++--
 ...m-wide-libdir-in-case-of-source-based-dep.patch |   32 ++++
 ...-No-erlang-min-2-and-erlang-max-2-in-R12B.patch |   43 ------
 ...ction-lists-keyfind-3-in-R12B5-use-lists-.patch |  137 ------------------
 ...traces-of-long-time-obsolete-escript-fold.patch |   31 ++++
 rebar-0007-No-such-type-dict-in-R12B.patch         |   26 ----
 ...abnfc-compiler-support-n-a-in-Fedora-EPEL.patch |  149 ++++++++++++++++++++
 rebar-0008-Adjust-app-version.patch                |   26 ++++
 rebar-0008-No-such-directive-opaque-in-R12B.patch  |   30 ----
 rebar-0009-No-such-type-boolean-in-R12B.patch      |   26 ----
 sources                                            |    2 +-
 16 files changed, 401 insertions(+), 482 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e0be0ef..eb1c0b2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
 /basho-rebar-RELEASE-1-327-g90058c7.tar.gz
 /basho-rebar-RELEASE-1-821-g635d1a9.tar.gz
 /basho-rebar-2.0.0-0-g1c98f6c.tar.gz
+/basho-rebar-2.1.0-pre-0-gebb474b.tar.gz
diff --git a/erlang-rebar.spec b/erlang-rebar.spec
index e3cb943..09dad58 100644
--- a/erlang-rebar.spec
+++ b/erlang-rebar.spec
@@ -1,19 +1,19 @@
 %global realname rebar
 %global upstream basho
 %global debug_package %{nil}
-%global git_tag 1c98f6c
+%global git_tag ebb474b
 %global patchnumber 0
 
 
 Name:		erlang-%{realname}
-Version:	2.0.0
-Release:	4%{?dist}
+Version:	2.1.0
+Release:	0.1%{?dist}
 Summary:	Erlang Build Tools
 Group:		Development/Tools
 License:	MIT
-URL:		https://github.com/basho/rebar
-# wget --content-disposition https://github.com/basho/rebar/tarball/635d1a9
-Source0:	%{upstream}-%{realname}-%{version}-%{patchnumber}-g%{git_tag}.tar.gz
+URL:		https://github.com/rebar/rebar
+# wget --content-disposition https://github.com/basho/rebar/tarball/ebb474b
+Source0:	%{upstream}-%{realname}-%{version}-pre-%{patchnumber}-g%{git_tag}.tar.gz
 Source1:	rebar.escript
 # Fedora/EPEL-specific
 Patch1:		rebar-0001-No-need-to-create-bundle-and-don-t-try-to-load-anyth.patch
@@ -21,56 +21,47 @@ Patch1:		rebar-0001-No-need-to-create-bundle-and-don-t-try-to-load-anyth.patch
 Patch2:		rebar-0002-Remove-bundled-mustache.patch
 # Fedora/EPEL-specific
 Patch3:		rebar-0003-Remove-bundled-getopt.patch
+# Will be proposed for inclusion
 Patch4:		rebar-0004-Allow-discarding-building-ports.patch
-# R12B - EPEL5-specific
-Patch5:		rebar-0005-No-erlang-min-2-and-erlang-max-2-in-R12B.patch
-# R12B - EPEL5-specific
-Patch6:		rebar-0006-No-such-function-lists-keyfind-3-in-R12B5-use-lists-.patch
-# R12B - EPEL5-specific
-Patch7:		rebar-0007-No-such-type-dict-in-R12B.patch
-# R12B - EPEL5-specific
-Patch8:		rebar-0008-No-such-directive-opaque-in-R12B.patch
-# R12B - EPEL5-specific
-Patch9:		rebar-0009-No-such-type-boolean-in-R12B.patch
-BuildRoot:	%(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
+# Fedora/EPEL-specific
+Patch5:		rebar-0005-Check-system-wide-libdir-in-case-of-source-based-dep.patch
+# Fedora/EPEL-specific
+Patch6:		rebar-0006-Remove-any-traces-of-long-time-obsolete-escript-fold.patch
+# Fedora/EPEL-specific - unfortunately we don't have abnfc compiler available yet
+Patch7:		rebar-0007-Remove-abnfc-compiler-support-n-a-in-Fedora-EPEL.patch
+# Fedora/EPEL-specific - cosmetic
+Patch8:		rebar-0008-Adjust-app-version.patch
 BuildRequires:	erlang-erts
 BuildRequires:	erlang-getopt
 BuildRequires:	erlang-erl_interface
-%if 0%{?el6}%{?fedora}
-# No reltool at all in R12B
 BuildRequires:	erlang-reltool
-%endif
-# wip
-#Requires:	erlang-abnfc
-Requires:	erlang-asn1
-Requires:	erlang-compiler
-Requires:	erlang-crypto
+# FIXME wip
+#Requires:	erlang-abnfc%{?_isa}
+Requires:	erlang-asn1%{?_isa}
+Requires:	erlang-compiler%{?_isa}
+Requires:	erlang-crypto%{?_isa}
 # FIXME does it still needed?
-Requires:	erlang-dialyzer
-Requires:	erlang-edoc
-%if 0%{?el6}%{?fedora}
-# No erlydtl in EPEL5 so far
-Requires:	erlang-erlydtl
-%endif
-Requires:	erlang-erts
+Requires:	erlang-dialyzer%{?_isa}
+Requires:	erlang-edoc%{?_isa}
+Requires:	erlang-erlydtl%{?_isa}
+Requires:	erlang-erts%{?_isa}
 # Requires for port compiling - no direct references in Rebar's src/*.erl files
-Requires:	erlang-erl_interface
-Requires:	erlang-eunit
-Requires:	erlang-getopt
-Requires:	erlang-kernel
-Requires:	erlang-lfe
-Requires:	erlang-mustache
-Requires:	erlang-neotoma
-Requires:	erlang-protobuffs
-%if 0%{?el6}%{?fedora}
-# No reltool at all in R12B
-Requires:	erlang-reltool
-%endif
-Requires:	erlang-sasl
-Requires:	erlang-snmp
-Requires:	erlang-stdlib
-Requires:	erlang-syntax_tools
-Requires:	erlang-tools
+Requires:	erlang-erl_interface%{?_isa}
+# Autochecker picks up a missing dependency in R16 - eunit_test:function_wrapper/2.
+# This function was remove in R16 and rebar contains a workaround for that so don't worry.
+Requires:	erlang-eunit%{?_isa}
+Requires:	erlang-getopt%{?_isa}
+Requires:	erlang-kernel%{?_isa}
+Requires:	erlang-lfe%{?_isa}
+Requires:	erlang-mustache%{?_isa}
+Requires:	erlang-neotoma%{?_isa}
+Requires:	erlang-protobuffs%{?_isa}
+Requires:	erlang-reltool%{?_isa}
+Requires:	erlang-sasl%{?_isa}
+Requires:	erlang-snmp%{?_isa}
+Requires:	erlang-stdlib%{?_isa}
+Requires:	erlang-syntax_tools%{?_isa}
+Requires:	erlang-tools%{?_isa}
 Provides:	%{realname} = %{version}-%{release}
 
 
@@ -84,27 +75,10 @@ Erlang Build Tools.
 %patch2 -p1 -b .remove_bundled_mustache
 %patch3 -p1 -b .remove_bundled_getopt
 %patch4 -p1 -b .allow_discarding_ports
-%if 0%{?el5}
-%patch5 -p1
-%patch6 -p1
-%patch7 -p1
-%patch8 -p1
-%patch9 -p1
-%endif
-# FIXME enable back when erlang-abnfc will be available
-rm -f src/rebar_abnfc_compiler.erl
-sed -i -e "/rebar_abnfc_compiler/d" ebin/rebar.app
-%if 0%{?el5}
-# Remove erlydtl support
-rm -f src/rebar_erlydtl_compiler.erl
-sed -i -e "/rebar_erlydtl_compiler/d" ebin/rebar.app
-# Remove reltool support - no reltool at all in the R12B
-rm -f src/rebar_reltool.erl
-sed -i -e "/rebar_reltool/d" ebin/rebar.app
-# Remove templater support - not required just for building anyway
-rm -f src/rebar_templater.erl
-sed -i -e "/rebar_templater/d" ebin/rebar.app
-%endif
+%patch5 -p1 -b .use_locally_installed
+%patch6 -p1 -b .remove_escript_foldl_3
+%patch7 -p1 -b .no_abnfc
+%patch8 -p1 -b .adjust_ver
 
 
 %build
@@ -112,28 +86,26 @@ sed -i -e "/rebar_templater/d" ebin/rebar.app
 
 
 %install
-rm -rf $RPM_BUILD_ROOT
-install -D -p -m 0755 %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/rebar
-mkdir -p $RPM_BUILD_ROOT%{_libdir}/erlang/lib/%{realname}-%{version}/ebin
-mkdir -p $RPM_BUILD_ROOT%{_libdir}/erlang/lib/%{realname}-%{version}/include
-install -m 644 ebin/%{realname}.app $RPM_BUILD_ROOT%{_libdir}/erlang/lib/%{realname}-%{version}/ebin
-install -m 644 ebin/*.beam $RPM_BUILD_ROOT%{_libdir}/erlang/lib/%{realname}-%{version}/ebin
-install -m 644 include/*.hrl $RPM_BUILD_ROOT%{_libdir}/erlang/lib/%{realname}-%{version}/include
-cp -a priv $RPM_BUILD_ROOT%{_libdir}/erlang/lib/%{realname}-%{version}/
-
-
-%clean
-rm -rf $RPM_BUILD_ROOT
+install -D -p -m 0755 %{SOURCE1} %{buildroot}%{_bindir}/rebar
+mkdir -p %{buildroot}%{_libdir}/erlang/lib/%{realname}-%{version}/ebin
+mkdir -p %{buildroot}%{_libdir}/erlang/lib/%{realname}-%{version}/include
+install -m 644 ebin/%{realname}.app %{buildroot}%{_libdir}/erlang/lib/%{realname}-%{version}/ebin
+install -m 644 ebin/*.beam %{buildroot}%{_libdir}/erlang/lib/%{realname}-%{version}/ebin
+install -m 644 include/*.hrl %{buildroot}%{_libdir}/erlang/lib/%{realname}-%{version}/include
+cp -a priv %{buildroot}%{_libdir}/erlang/lib/%{realname}-%{version}/
 
 
 %files
-%defattr(-,root,root,-)
-%doc THANKS rebar.config.sample
+%doc LICENSE NOTES.org README.md THANKS rebar.config.sample
 %{_bindir}/rebar
 %{_libdir}/erlang/lib/%{realname}-%{version}
 
 
 %changelog
+* Sat Mar 02 2013 Peter Lemenkov <lemenkov at gmail.com> - 2.1.0-0.1
+- Ver. 2.1.0-pre
+- Remove R12B-related patches (EL5-related)
+
 * Wed Feb 13 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.0.0-4
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
 
diff --git a/rebar-0001-No-need-to-create-bundle-and-don-t-try-to-load-anyth.patch b/rebar-0001-No-need-to-create-bundle-and-don-t-try-to-load-anyth.patch
index c022af6..aa1516d 100644
--- a/rebar-0001-No-need-to-create-bundle-and-don-t-try-to-load-anyth.patch
+++ b/rebar-0001-No-need-to-create-bundle-and-don-t-try-to-load-anyth.patch
@@ -1,49 +1,29 @@
-From 05b31a23c8d70a3867173823478defe029b89c5d Mon Sep 17 00:00:00 2001
+From 878bc0156c540ce55f97c3a97afafe8537560f7a Mon Sep 17 00:00:00 2001
 From: Peter Lemenkov <lemenkov at gmail.com>
 Date: Tue, 28 Sep 2010 23:04:36 +0400
-Subject: [PATCH 1/9] No need to create bundle and don't try to load anything
+Subject: [PATCH 1/8] No need to create bundle and don't try to load anything
  from escript
 
 Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>
+
+Conflicts:
+	bootstrap
+	src/rebar_templater.erl
 ---
- bootstrap               | 40 ----------------------------------------
- src/rebar_templater.erl | 30 ++----------------------------
- 2 files changed, 2 insertions(+), 68 deletions(-)
+ bootstrap               | 16 +---------------
+ src/rebar_templater.erl | 31 +++++--------------------------
+ 2 files changed, 6 insertions(+), 41 deletions(-)
 
 diff --git a/bootstrap b/bootstrap
-index c8a40de..be0523a 100755
+index 70d8da1..e777d19 100755
 --- a/bootstrap
 +++ b/bootstrap
-@@ -56,46 +56,6 @@ main(Args) ->
-     %% Run rebar to do proper .app validation and such
-     rebar:main(["compile"] ++ Args),
+@@ -55,21 +55,7 @@ main(Args) ->
+     true = code:add_path("ebin"),
  
--    %% Read the contents of the files in ebin and templates; note that we
--    %% place all the beam files at the top level of the code archive so
--    %% that code loading works properly.
--    Files = load_files("*", "ebin") ++ load_files("priv/templates/*", "."),
--
--    case zip:create("mem", Files, [memory]) of
--        {ok, {"mem", ZipBin}} ->
--            %% Archive was successfully created. Prefix that binary with our
--            %% header and write to "rebar" file.
--            %% Without -noshell -noinput escript consumes all input that would
--            %% otherwise go to the shell for the next command.
--            Script = <<"#!/usr/bin/env escript\n%%! -noshell -noinput\n",
--                       ZipBin/binary>>,
--            case file:write_file("rebar", Script) of
--                ok ->
--                    ok;
--                {error, WriteError} ->
--                    io:format("Failed to write rebar script: ~p\n",
--                              [WriteError]),
--                    halt(1)
--            end;
--        {error, ZipError} ->
--            io:format("Failed to construct rebar script archive: ~p\n",
--                      [ZipError]),
--            halt(1)
--    end,
+     %% Run rebar compile to do proper .app validation etc.
+-    %% and rebar escriptize to create the rebar script
+-    rebar:main(["compile", "escriptize"] ++ Args),
 -
 -    %% Finally, update executable perms for our script on *nix,
 -    %%  or write out script files on win32.
@@ -57,79 +37,69 @@ index c8a40de..be0523a 100755
 -        _ ->
 -            ok
 -    end,
--
++    rebar:main(["compile"] ++ Args),
+ 
      %% Add a helpful message
      io:format("Congratulations! You now have a self-contained script called"
-               " \"rebar\" in\n"
 diff --git a/src/rebar_templater.erl b/src/rebar_templater.erl
-index f608512..450eb4d 100644
+index 0e1eef1..7cc36f7 100644
 --- a/src/rebar_templater.erl
 +++ b/src/rebar_templater.erl
-@@ -54,11 +54,6 @@
-     create(Config, File).
+@@ -167,27 +167,11 @@ create1(Config, TemplateId) ->
+     execute_template(Files, FinalTemplate, Type, Template, Context, Force, []).
  
- 'list-templates'(_Config, _File) ->
--    %% Load a list of all the files in the escript -- cache it in the pdict
--    %% since we'll potentially need to walk it several times over the course
--    %% of a run.
--    cache_escript_files(),
+ find_templates(Config) ->
+-    %% Load a list of all the files in the escript -- cache them since
+-    %% we'll potentially need to walk it several times over the course of
+-    %% a run.
+-    Files = cache_escript_files(Config),
 -
      %% Build a list of available templates
-     AvailTemplates = find_disk_templates() ++ find_escript_templates(),
-     ?CONSOLE("Available templates:\n", []),
-@@ -70,11 +65,6 @@
- 
- 
- create(_Config, _) ->
--    %% Load a list of all the files in the escript -- cache it in the pdict
--    %% since we'll potentially need to walk it several times over the course
--    %% of a run.
--    cache_escript_files(),
+     AvailTemplates = find_disk_templates(Config)
+-        ++ find_escript_templates(Files),
 -
-     %% Build a list of available templates
-     AvailTemplates = find_disk_templates() ++ find_escript_templates(),
-     ?DEBUG("Available templates: ~p\n", [AvailTemplates]),
-@@ -174,18 +164,6 @@ render(Bin, Context) ->
- %% Internal functions
- %% ===================================================================
+-    {AvailTemplates, Files}.
++        ++ find_escript_templates(),
  
 -%%
--%% Scan the current escript for available files and cache in pdict.
+-%% Scan the current escript for available files
 -%%
--cache_escript_files() ->
+-cache_escript_files(Config) ->
 -    {ok, Files} = rebar_utils:escript_foldl(
 -                    fun(Name, _, GetBin, Acc) ->
 -                            [{Name, GetBin()} | Acc]
 -                    end,
--                    [], rebar_config:get_global(escript, undefined)),
--    erlang:put(escript_files, Files).
--
--
- template_id() ->
-     case rebar_config:get_global(template, undefined) of
-         undefined ->
-@@ -195,8 +173,7 @@ template_id() ->
+-                    [], rebar_config:get_xconf(Config, escript)),
+-    Files.
++    {AvailTemplates, []}.
+ 
+ template_id(Config) ->
+     case rebar_config:get_global(Config, template, undefined) of
+@@ -197,10 +181,8 @@ template_id(Config) ->
+             TemplateId
      end.
  
- find_escript_templates() ->
--    [{escript, Name} || {Name, _Bin} <- erlang:get(escript_files),
--                        re:run(Name, ?TEMPLATE_RE, [{capture, none}]) == match].
-+    [{escript, Name} || Name <- rebar_utils:find_files(code:priv_dir(rebar) ++ "/templates", ?TEMPLATE_RE)].
+-find_escript_templates(Files) ->
+-    [{escript, Name}
+-     || {Name, _Bin} <- Files,
+-        re:run(Name, ?TEMPLATE_RE, [{capture, none}]) == match].
++find_escript_templates() ->
++    [{file, Name} || Name <- rebar_utils:find_files(code:priv_dir(rebar) ++ "/templates", ?TEMPLATE_RE)].
  
- find_disk_templates() ->
-     OtherTemplates = find_other_templates(),
-@@ -227,10 +204,7 @@ select_template([{Type, Avail} | Rest], Template) ->
+ find_disk_templates(Config) ->
+     OtherTemplates = find_other_templates(Config),
+@@ -231,10 +213,7 @@ select_template([{Type, Avail} | Rest], Template) ->
  %%
  %% Read the contents of a file from the appropriate source
  %%
--load_file(escript, Name) ->
--    {Name, Bin} = lists:keyfind(Name, 1, erlang:get(escript_files)),
+-load_file(Files, escript, Name) ->
+-    {Name, Bin} = lists:keyfind(Name, 1, Files),
 -    Bin;
--load_file(file, Name) ->
-+load_file(_, Name) ->
+-load_file(_Files, file, Name) ->
++load_file(_Files, _, Name) ->
      {ok, Bin} = file:read_file(Name),
      Bin.
  
 -- 
-1.8.0.1
+1.8.1.4
 
diff --git a/rebar-0002-Remove-bundled-mustache.patch b/rebar-0002-Remove-bundled-mustache.patch
index e042c2a..d43db2a 100644
--- a/rebar-0002-Remove-bundled-mustache.patch
+++ b/rebar-0002-Remove-bundled-mustache.patch
@@ -1,20 +1,20 @@
-From 73c2af44588a4bc15d2ab6b8aefb28f0a47775b2 Mon Sep 17 00:00:00 2001
+From d384b7a4a72e9b566b89b517b3e7953c9f41c529 Mon Sep 17 00:00:00 2001
 From: Peter Lemenkov <lemenkov at gmail.com>
 Date: Sat, 20 Nov 2010 16:36:45 +0300
-Subject: [PATCH 2/9] Remove bundled mustache
+Subject: [PATCH 2/8] Remove bundled mustache
 
 Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>
 ---
  ebin/rebar.app   |   3 +-
- src/mustache.erl | 234 -------------------------------------------------------
- 2 files changed, 1 insertion(+), 236 deletions(-)
+ src/mustache.erl | 228 -------------------------------------------------------
+ 2 files changed, 1 insertion(+), 230 deletions(-)
  delete mode 100644 src/mustache.erl
 
 diff --git a/ebin/rebar.app b/ebin/rebar.app
-index 5689b35..cb4ab64 100644
+index 8df929f..9e000fa 100644
 --- a/ebin/rebar.app
 +++ b/ebin/rebar.app
-@@ -35,8 +35,7 @@
+@@ -37,8 +37,7 @@
                rebar_upgrade,
                rebar_utils,
                rebar_xref,
@@ -26,10 +26,10 @@ index 5689b35..cb4ab64 100644
                    stdlib,
 diff --git a/src/mustache.erl b/src/mustache.erl
 deleted file mode 100644
-index ac501a0..0000000
+index f6963cd..0000000
 --- a/src/mustache.erl
 +++ /dev/null
-@@ -1,234 +0,0 @@
+@@ -1,228 +0,0 @@
 -%% The MIT License
 -%%
 -%% Copyright (c) 2009 Tom Preston-Werner <tom at mojombo.com>
@@ -63,10 +63,6 @@ index ac501a0..0000000
 -                 section_re = undefined,
 -                 tag_re = undefined}).
 -
---ifdef(TEST).
---include_lib("eunit/include/eunit.hrl").
---endif.
--
 -compile(Body) when is_list(Body) ->
 -  State = #mstate{},
 -  CompiledTemplate = pre_compile(Body, State),
@@ -145,9 +141,9 @@ index ac501a0..0000000
 -  Result = compiler(Content, State),
 -  "fun() -> " ++
 -    "case mustache:get(" ++ Name ++ ", Ctx, " ++ atom_to_list(Mod) ++ ") of " ++
--      "true -> " ++
+-      "\"true\" -> " ++
 -        Result ++ "; " ++
--      "false -> " ++
+-      "\"false\" -> " ++
 -        "[]; " ++
 -      "List when is_list(List) -> " ++
 -        "[fun(Ctx) -> " ++ Result ++ " end(dict:merge(CFun, SubCtx, Ctx)) || SubCtx <- List]; " ++
@@ -186,9 +182,21 @@ index ac501a0..0000000
 -compile_tag("!", _Content, _State) ->
 -  "[]".
 -
+-template_dir(Mod) ->
+-  DefaultDirPath = filename:dirname(code:which(Mod)),
+-  case application:get_env(mustache, templates_dir) of
+-    {ok, DirPath} when is_list(DirPath) ->
+-      case filelib:ensure_dir(DirPath) of
+-        ok -> DirPath;
+-        _  -> DefaultDirPath
+-      end;
+-    _ ->
+-      DefaultDirPath
+-  end.
 -template_path(Mod) ->
--  ModPath = code:which(Mod),
--  re:replace(ModPath, "\.beam$", ".mustache", [{return, list}]).
+-  DirPath = template_dir(Mod),
+-  Basename = atom_to_list(Mod),
+-  filename:join(DirPath, Basename ++ ".mustache").
 -
 -get(Key, Ctx) when is_list(Key) ->
 -  {ok, Mod} = dict:find('__mod__', Ctx),
@@ -250,20 +258,6 @@ index ac501a0..0000000
 -start([T]) ->
 -  Out = render(list_to_atom(T)),
 -  io:format(Out ++ "~n", []).
--
---ifdef(TEST).
--
--simple_test() ->
--    Ctx = dict:from_list([{name, "world"}]),
--    Result = render("Hello {{name}}!", Ctx),
--    ?assertEqual("Hello world!", Result).
--
--integer_values_too_test() ->
--    Ctx = dict:from_list([{name, "Chris"}, {value, 10000}]),
--    Result = render("Hello {{name}}~nYou have just won ${{value}}!", Ctx),
--    ?assertEqual("Hello Chris~nYou have just won $10000!", Result).
--
---endif.
 -- 
-1.8.0.1
+1.8.1.4
 
diff --git a/rebar-0003-Remove-bundled-getopt.patch b/rebar-0003-Remove-bundled-getopt.patch
index 624a727..0da092c 100644
--- a/rebar-0003-Remove-bundled-getopt.patch
+++ b/rebar-0003-Remove-bundled-getopt.patch
@@ -1,7 +1,7 @@
-From f8b747a9fc7126bec35c1e4bc81257baa838e289 Mon Sep 17 00:00:00 2001
+From a58888207ee87f8db746cb91896c9d804f5af5fe Mon Sep 17 00:00:00 2001
 From: Peter Lemenkov <lemenkov at gmail.com>
 Date: Sat, 20 Nov 2010 16:40:15 +0300
-Subject: [PATCH 3/9] Remove bundled getopt
+Subject: [PATCH 3/8] Remove bundled getopt
 
 Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>
 ---
@@ -11,10 +11,10 @@ Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>
  delete mode 100644 src/getopt.erl
 
 diff --git a/ebin/rebar.app b/ebin/rebar.app
-index cb4ab64..cf69b8a 100644
+index 9e000fa..cba8bf8 100644
 --- a/ebin/rebar.app
 +++ b/ebin/rebar.app
-@@ -34,8 +34,7 @@
+@@ -36,8 +36,7 @@
                rebar_templater,
                rebar_upgrade,
                rebar_utils,
@@ -652,5 +652,5 @@ index 175b7a5..0000000
 -            T
 -    end.
 -- 
-1.8.0.1
+1.8.1.4
 
diff --git a/rebar-0004-Allow-discarding-building-ports.patch b/rebar-0004-Allow-discarding-building-ports.patch
index df23c69..759b1bd 100644
--- a/rebar-0004-Allow-discarding-building-ports.patch
+++ b/rebar-0004-Allow-discarding-building-ports.patch
@@ -1,27 +1,33 @@
-From b65a6fee95d3e97fc7047493ff4bd907971043d9 Mon Sep 17 00:00:00 2001
+From 6864f0550b09b95f2a56eee45691c77d28e1b056 Mon Sep 17 00:00:00 2001
 From: Peter Lemenkov <lemenkov at gmail.com>
 Date: Tue, 5 Jun 2012 15:10:12 +0400
-Subject: [PATCH 4/9] Allow discarding building ports
+Subject: [PATCH 4/8] Allow discarding building ports
 
 Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>
+
+Conflicts:
+	src/rebar_port_compiler.erl
 ---
- src/rebar_port_compiler.erl | 3 +++
- 1 file changed, 3 insertions(+)
+ src/rebar_port_compiler.erl | 6 ++++++
+ 1 file changed, 6 insertions(+)
 
 diff --git a/src/rebar_port_compiler.erl b/src/rebar_port_compiler.erl
-index cdd9be6..e56089b 100644
+index 71b27a5..d9837ed 100644
 --- a/src/rebar_port_compiler.erl
 +++ b/src/rebar_port_compiler.erl
-@@ -110,6 +110,9 @@ compile(Config, AppFile) ->
-             ok;                                 % old specs empty
-         {new, [], []} ->
-             ok;                                 % port_specs empty
-+        {_, _, [{_,_,_,[],[],_}]} ->
-+            % Special case to discard port processing at all
-+            ok;                                 % port_specs empty
- 
-         _ ->                                    % have old/new specs
- 
+@@ -253,6 +253,12 @@ get_specs(Config, AppFile) ->
+             %% No spec provided. Construct a spec
+             %% from old-school so_name and sources
+             [port_spec_from_legacy(Config, AppFile)];
++        [{null,[]}] ->
++            [];
++        [null] ->
++            [];
++        [skip] ->
++            [];
+         PortSpecs ->
+             Filtered = filter_port_specs(PortSpecs),
+             OsType = os:type(),
 -- 
-1.8.0.1
+1.8.1.4
 
diff --git a/rebar-0005-Check-system-wide-libdir-in-case-of-source-based-dep.patch b/rebar-0005-Check-system-wide-libdir-in-case-of-source-based-dep.patch
new file mode 100644
index 0000000..e49aa82
--- /dev/null
+++ b/rebar-0005-Check-system-wide-libdir-in-case-of-source-based-dep.patch
@@ -0,0 +1,32 @@
+From 9e20065f7bcf0533b8aec4a3c2108353c4f4078a Mon Sep 17 00:00:00 2001
+From: Peter Lemenkov <lemenkov at gmail.com>
+Date: Sat, 2 Mar 2013 10:39:15 +0400
+Subject: [PATCH 5/8] Check system-wide libdir in case of source-based
+ dependency
+
+Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>
+---
+ src/rebar_deps.erl | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/src/rebar_deps.erl b/src/rebar_deps.erl
+index 074e929..9cc82f7 100644
+--- a/src/rebar_deps.erl
++++ b/src/rebar_deps.erl
+@@ -305,7 +305,12 @@ find_dep(Config, Dep, _Source) ->
+     %% _Source is defined.  Regardless of what it is, we must find it
+     %% locally satisfied or fetch it from the original source
+     %% into the project's deps
+-    find_dep_in_dir(Config, Dep, get_deps_dir(Config, Dep#dep.app)).
++    case find_dep_in_dir(Config, Dep, get_deps_dir(Config, Dep#dep.app)) of
++        {_Config1, {avail, _Dir}} = Avail ->
++            Avail;
++        {Config1, {missing, _}} ->
++            find_dep_in_dir(Config1, Dep, get_lib_dir(Dep#dep.app))
++    end.
+ 
+ find_dep_in_dir(Config, _Dep, {false, Dir}) ->
+     {Config, {missing, Dir}};
+-- 
+1.8.1.4
+
diff --git a/rebar-0006-Remove-any-traces-of-long-time-obsolete-escript-fold.patch b/rebar-0006-Remove-any-traces-of-long-time-obsolete-escript-fold.patch
new file mode 100644
index 0000000..fa2809f
--- /dev/null
+++ b/rebar-0006-Remove-any-traces-of-long-time-obsolete-escript-fold.patch
@@ -0,0 +1,31 @@
+From 1d6e1d3b4fad6fd9f922377612e948d1e8548328 Mon Sep 17 00:00:00 2001
+From: Peter Lemenkov <lemenkov at gmail.com>
+Date: Sat, 2 Mar 2013 13:35:36 +0400
+Subject: [PATCH 6/8] Remove any traces of long-time obsolete escript:foldl/3
+
+Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>
+---
+ src/rebar_utils.erl | 7 +------
+ 1 file changed, 1 insertion(+), 6 deletions(-)
+
+diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl
+index bb58460..c86c210 100644
+--- a/src/rebar_utils.erl
++++ b/src/rebar_utils.erl
+@@ -155,12 +155,7 @@ abort(String, Args) ->
+ %% undocumented exported fun and has been removed in R14.
+ escript_foldl(Fun, Acc, File) ->
+     {module, zip} = code:ensure_loaded(zip),
+-    case erlang:function_exported(zip, foldl, 3) of
+-        true ->
+-            emulate_escript_foldl(Fun, Acc, File);
+-        false ->
+-            escript:foldl(Fun, Acc, File)
+-    end.
++    emulate_escript_foldl(Fun, Acc, File).
+ 
+ find_executable(Name) ->
+     case os:find_executable(Name) of
+-- 
+1.8.1.4
+
diff --git a/rebar-0007-Remove-abnfc-compiler-support-n-a-in-Fedora-EPEL.patch b/rebar-0007-Remove-abnfc-compiler-support-n-a-in-Fedora-EPEL.patch
new file mode 100644
index 0000000..dc384c7
--- /dev/null
+++ b/rebar-0007-Remove-abnfc-compiler-support-n-a-in-Fedora-EPEL.patch
@@ -0,0 +1,149 @@
+From 07d92a8802cfdffc1688b33647d8d56108dd3b2e Mon Sep 17 00:00:00 2001
+From: Peter Lemenkov <lemenkov at gmail.com>
+Date: Sat, 2 Mar 2013 13:52:04 +0400
+Subject: [PATCH 7/8] Remove abnfc compiler support (n/a in Fedora/EPEL)
+
+Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>
+---
+ ebin/rebar.app               |   2 -
+ src/rebar_abnfc_compiler.erl | 108 -------------------------------------------
+ 2 files changed, 110 deletions(-)
+ delete mode 100644 src/rebar_abnfc_compiler.erl
+
+diff --git a/ebin/rebar.app b/ebin/rebar.app
+index cba8bf8..e84e905 100644
+--- a/ebin/rebar.app
++++ b/ebin/rebar.app
+@@ -5,7 +5,6 @@
+  [{description, "Rebar: Erlang Build Tool"},
+   {vsn, "2.1.0-pre"},
+   {modules, [ rebar,
+-              rebar_abnfc_compiler,
+               rebar_app_utils,
+               rebar_appups,
+               rebar_asn1_compiler,
+@@ -61,7 +60,6 @@
+          %% Dir specific processing modules
+          {modules, [
+                     {app_dir, [
+-                               rebar_abnfc_compiler,
+                                rebar_protobuffs_compiler,
+                                rebar_neotoma_compiler,
+                                rebar_asn1_compiler,
+diff --git a/src/rebar_abnfc_compiler.erl b/src/rebar_abnfc_compiler.erl
+deleted file mode 100644
+index 0e6749a..0000000
+--- a/src/rebar_abnfc_compiler.erl
++++ /dev/null
+@@ -1,108 +0,0 @@
+-%% -*- erlang-indent-level: 4;indent-tabs-mode: nil -*-
+-%% ex: ts=4 sw=4 et
+-%% -------------------------------------------------------------------
+-%%
+-%% rebar: Erlang Build Tools
+-%%
+-%% Copyright (c) 2010 Anthony Ramine (nox at dev-extend.eu),
+-%%
+-%% Permission is hereby granted, free of charge, to any person obtaining a copy
+-%% of this software and associated documentation files (the "Software"), to deal
+-%% in the Software without restriction, including without limitation the rights
+-%% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+-%% copies of the Software, and to permit persons to whom the Software is
+-%% furnished to do so, subject to the following conditions:
+-%%
+-%% The above copyright notice and this permission notice shall be included in
+-%% all copies or substantial portions of the Software.
+-%%
+-%% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+-%% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+-%% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+-%% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+-%% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+-%% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+-%% THE SOFTWARE.
+-%% -------------------------------------------------------------------
+-
+-%% The rebar_abnfc_compiler module is a plugin for rebar that compiles
+-%% ABNF grammars into parsers.  By default, it compiles all src/*.abnf
+-%% to src/*.erl.
+-%%
+-%% Configuration options should be placed in rebar.config under
+-%% 'abnfc_opts'.  Available options include:
+-%%
+-%%  doc_root: where to find the ABNF grammars to compile
+-%%            "src" by default
+-%%
+-%%  out_dir: where to put the generated files.
+-%%           "src" by default
+-%%
+-%%  source_ext: the file extension the ABNF grammars have.
+-%%              ".abnf" by default
+-%%
+-%%  module_ext: characters to append to the parser's module name
+-%%              "" by default
+--module(rebar_abnfc_compiler).
+-
+--export([compile/2]).
+-
+--include("rebar.hrl").
+-
+-%% ===================================================================
+-%% Public API
+-%% ===================================================================
+-
+-compile(Config, _AppFile) ->
+-    DtlOpts = abnfc_opts(Config),
+-    rebar_base_compiler:run(Config, [],
+-                            option(doc_root, DtlOpts),
+-                            option(source_ext, DtlOpts),
+-                            option(out_dir, DtlOpts),
+-                            option(module_ext, DtlOpts) ++ ".erl",
+-                            fun compile_abnfc/3).
+-
+-
+-%% ===================================================================
+-%% Internal functions
+-%% ===================================================================
+-
+-abnfc_opts(Config) ->
+-    rebar_config:get(Config, abnfc_opts, []).
+-
+-option(Opt, DtlOpts) ->
+-    proplists:get_value(Opt, DtlOpts, default(Opt)).
+-
+-default(doc_root) -> "src";
+-default(out_dir)  -> "src";
+-default(source_ext) -> ".abnf";
+-default(module_ext) -> "".
+-
+-abnfc_is_present() ->
+-    code:which(abnfc) =/= non_existing.
+-
+-compile_abnfc(Source, _Target, Config) ->
+-    case abnfc_is_present() of
+-        false ->
+-            ?ERROR("~n===============================================~n"
+-                   " You need to install abnfc to compile ABNF grammars~n"
+-                   " Download the latest tarball release from github~n"
+-                   "    https://github.com/nygge/abnfc~n"
+-                   " and install it into your erlang library dir~n"
+-                   "===============================================~n~n", []),
+-            ?FAIL;
+-        true ->
+-            AbnfcOpts = abnfc_opts(Config),
+-            SourceExt = option(source_ext, AbnfcOpts),
+-            Opts = [noobj,
+-                    {o, option(out_dir, AbnfcOpts)},
+-                    {mod, filename:basename(Source, SourceExt) ++
+-                         option(module_ext, AbnfcOpts)}],
+-            case abnfc:file(Source, Opts) of
+-                ok -> ok;
+-                Error ->
+-                    ?ERROR("Compiling grammar ~s failed:~n  ~p~n",
+-                           [Source, Error]),
+-                    ?FAIL
+-            end
+-    end.
+-- 
+1.8.1.4
+
diff --git a/rebar-0008-Adjust-app-version.patch b/rebar-0008-Adjust-app-version.patch
new file mode 100644
index 0000000..734fdbc
--- /dev/null
+++ b/rebar-0008-Adjust-app-version.patch
@@ -0,0 +1,26 @@
+From 030eed84bf2d6461df036fc7231eaaf78de9489f Mon Sep 17 00:00:00 2001
+From: Peter Lemenkov <lemenkov at gmail.com>
+Date: Sat, 2 Mar 2013 13:52:35 +0400
+Subject: [PATCH 8/8] Adjust app version
+
+Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>
+---
+ ebin/rebar.app | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/ebin/rebar.app b/ebin/rebar.app
+index e84e905..3f0aabe 100644
+--- a/ebin/rebar.app
++++ b/ebin/rebar.app
+@@ -3,7 +3,7 @@
+ 
+ {application, rebar,
+  [{description, "Rebar: Erlang Build Tool"},
+-  {vsn, "2.1.0-pre"},
++  {vsn, "2.1.0"},
+   {modules, [ rebar,
+               rebar_app_utils,
+               rebar_appups,
+-- 
+1.8.1.4
+
diff --git a/sources b/sources
index 1bef9c0..ee9d6dc 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-c7fd0775e25c5ab55c2ddef859f56816  basho-rebar-2.0.0-0-g1c98f6c.tar.gz
+43a094165eb54b474e6b6aa95f1b3f8b  basho-rebar-2.1.0-pre-0-gebb474b.tar.gz


More information about the scm-commits mailing list