~clint-fewbar/ubuntu/precise/erlang/merge-15b

« back to all changes in this revision

Viewing changes to lib/reltool/src/reltool_target.erl

  • Committer: Package Import Robot
  • Author(s): Sergei Golovan
  • Date: 2011-12-15 19:20:10 UTC
  • mfrom: (1.1.18) (3.5.15 sid)
  • mto: (3.5.16 sid)
  • mto: This revision was merged to the branch mainline in revision 33.
  • Revision ID: package-import@ubuntu.com-20111215192010-jnxcfe3tbrpp0big
Tags: 1:15.b-dfsg-1
* New upstream release.
* Upload to experimental because this release breaks external drivers
  API along with ABI, so several applications are to be fixed.
* Removed SSL patch because the old SSL implementation is removed from
  the upstream distribution.
* Removed never used patch which added native code to erlang beam files.
* Removed the erlang-docbuilder binary package because the docbuilder
  application was dropped by upstream.
* Documented dropping ${erlang-docbuilder:Depends} substvar in
  erlang-depends(1) manpage.
* Made erlang-base and erlang-base-hipe provide virtual package
  erlang-abi-15.b (the number means the first erlang version, which
  provides current ABI).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
%%
2
2
%% %CopyrightBegin%
3
3
%%
4
 
%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
 
4
%% Copyright Ericsson AB 2009-2011. All Rights Reserved.
5
5
%%
6
6
%% The contents of this file are subject to the Erlang Public License,
7
7
%% Version 1.1, (the "License"); you may not use this file except in
90
90
                   debug_info           = DebugInfo},
91
91
              InclDefs) ->
92
92
    ErtsItems =
93
 
        case lists:keysearch(erts, #app.name, Apps) of
94
 
            {value, Erts} ->
95
 
                [{erts, do_gen_config(Erts, InclDefs)}];
96
 
            false ->
97
 
                []
 
93
        case lists:keyfind(erts, #app.name, Apps) of
 
94
            false ->
 
95
                [];
 
96
            Erts ->
 
97
                [{erts, do_gen_config(Erts, InclDefs)}]
98
98
        end,
99
99
    AppsItems =
100
100
        [do_gen_config(A, InclDefs)
521
521
                 Visited,
522
522
                 [],
523
523
                 []),
524
 
 
525
524
    Missing1 = NotFnd1 ++ NotFnd2 ++ Missing,
526
525
    case Uses ++ Incs of
527
526
        [] ->
533
532
            %% The apps in L must be started before the app.
534
533
            %% Check if we have already taken care of some app in L,
535
534
            %% in that case we have a circular dependency.
536
 
            NewCircular = [N1 || N1 <- L, N2 <- Visited, N1 =:= N2],
 
535
            NewCircular = [N || #app{name = N} <- L, N2 <- Visited, N =:= N2],
537
536
            Circular1 = case NewCircular of
538
537
                            [] -> Circular;
539
538
                            _ -> [Name | NewCircular] ++ Circular
558
557
                              [make_set(Circular), make_set(Missing)]).
559
558
 
560
559
find_all(CheckingApp, [Name | Names], Apps, Visited, Found, NotFound) ->
561
 
    case lists:keysearch(Name, #app.name, Apps) of
562
 
        {value, #app{info = Info} = App} ->
563
 
            %% It is OK to have a dependecy like
 
560
    case lists:keyfind(Name, #app.name, Apps) of
 
561
        #app{info = Info} = App ->
 
562
            %% It is OK to have a dependency like
564
563
            %% X includes Y, Y uses X.
565
564
            case lists:member(CheckingApp, Info#app_info.incl_apps) of
566
565
                true ->
1232
1231
    reltool_utils:write_file(TargetFile, BeamBin2).
1233
1232
 
1234
1233
cleanup_spec(List, TargetDir) when is_list(List) ->
1235
 
    lists:foreach(fun(F)-> cleanup_spec(F, TargetDir) end, List);
 
1234
    lists:foreach(fun(F) -> cleanup_spec(F, TargetDir) end, List);
1236
1235
%% cleanup_spec({source_dir, _SourceDir, Spec}, TargetDir) ->
1237
1236
%%     cleanup_spec(Spec, TargetDir);
1238
1237
cleanup_spec({create_dir, Dir, Files}, TargetDir) ->
1444
1443
 
1445
1444
subst_var([$%| Rest], Vars, Result, VarAcc) ->
1446
1445
    Key = lists:reverse(VarAcc),
1447
 
    case lists:keysearch(Key, 1, Vars) of
1448
 
        {value, {Key, Value}} ->
 
1446
    case lists:keyfind(Key, 1, Vars) of
 
1447
        {Key, Value} ->
1449
1448
            subst(Rest, Vars, lists:reverse(Value, Result));
1450
1449
        false ->
1451
1450
            subst(Rest, Vars, [$% | VarAcc ++ [$% | Result]])