Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E983F10D4C for ; Fri, 17 Jan 2014 23:14:16 +0000 (UTC) Received: (qmail 2095 invoked by uid 500); 17 Jan 2014 23:13:11 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 1233 invoked by uid 500); 17 Jan 2014 23:12:51 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 1092 invoked by uid 99); 17 Jan 2014 23:12:47 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Jan 2014 23:12:47 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 03E0237E25; Fri, 17 Jan 2014 23:12:47 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: davisp@apache.org To: commits@couchdb.apache.org Date: Fri, 17 Jan 2014 23:12:57 -0000 Message-Id: <6761a94c353241b39f6dfa29a2293bc9@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [12/50] git commit: Ignore skip_deps during update-deps as it has no meaning Ignore skip_deps during update-deps as it has no meaning Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/0977d583 Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/0977d583 Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/0977d583 Branch: refs/heads/import Commit: 0977d58361d54c170cf45254d7b53e1cd03024e7 Parents: cb4599f Author: Andrew Thompson Authored: Mon Sep 23 15:11:11 2013 -0400 Committer: Andrew Thompson Committed: Mon Sep 23 15:11:11 2013 -0400 ---------------------------------------------------------------------- src/rebar_deps.erl | 56 ++++++++++++++++++++++++------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/0977d583/src/rebar_deps.erl ---------------------------------------------------------------------- diff --git a/src/rebar_deps.erl b/src/rebar_deps.erl index 82c5061..15e7594 100644 --- a/src/rebar_deps.erl +++ b/src/rebar_deps.erl @@ -68,31 +68,6 @@ preprocess(Config, _) -> %% Add available deps to code path Config3 = update_deps_code_path(Config2, AvailableDeps), - %% If skip_deps=true, mark each dep dir as a skip_dir w/ the core so that - %% the current command doesn't run on the dep dir. However, pre/postprocess - %% WILL run (and we want it to) for transitivity purposes. - %% - %% Also, if skip_deps=comma,separated,app,list, then only the given - %% dependencies are skipped. - NewConfig = case rebar_config:get_global(Config3, skip_deps, false) of - "true" -> - lists:foldl( - fun(#dep{dir = Dir}, C) -> - rebar_config:set_skip_dir(C, Dir) - end, Config3, AvailableDeps); - Apps when is_list(Apps) -> - SkipApps = [list_to_atom(App) || App <- string:tokens(Apps, ",")], - lists:foldl( - fun(#dep{dir = Dir, app = App}, C) -> - case lists:member(App, SkipApps) of - true -> rebar_config:set_skip_dir(C, Dir); - false -> C - end - end, Config3, AvailableDeps); - _ -> - Config3 - end, - %% Filtering out 'raw' dependencies so that no commands other than %% deps-related can be executed on their directories. NonRawAvailableDeps = [D || D <- AvailableDeps, not D#dep.is_raw], @@ -103,13 +78,38 @@ preprocess(Config, _) -> %% any other calls to preprocess() for update-deps beyond the %% toplevel directory. They aren't actually harmful, but they slow %% things down unnecessarily. - NewConfig2 = lists:foldl(fun(D, Acc) -> + NewConfig = lists:foldl(fun(D, Acc) -> rebar_config:set_skip_dir(Acc, D#dep.dir) - end, NewConfig, collect_deps(rebar_utils:get_cwd(),NewConfig)), + end, Config3, collect_deps(rebar_utils:get_cwd(), Config3)), %% Return the empty list, as we don't want anything processed before %% us. - {ok, NewConfig2, []}; + {ok, NewConfig, []}; _ -> + %% If skip_deps=true, mark each dep dir as a skip_dir w/ the core so that + %% the current command doesn't run on the dep dir. However, pre/postprocess + %% WILL run (and we want it to) for transitivity purposes. + %% + %% Also, if skip_deps=comma,separated,app,list, then only the given + %% dependencies are skipped. + NewConfig = case rebar_config:get_global(Config3, skip_deps, false) of + "true" -> + lists:foldl( + fun(#dep{dir = Dir}, C) -> + rebar_config:set_skip_dir(C, Dir) + end, Config3, AvailableDeps); + Apps when is_list(Apps) -> + SkipApps = [list_to_atom(App) || App <- string:tokens(Apps, ",")], + lists:foldl( + fun(#dep{dir = Dir, app = App}, C) -> + case lists:member(App, SkipApps) of + true -> rebar_config:set_skip_dir(C, Dir); + false -> C + end + end, Config3, AvailableDeps); + _ -> + Config3 + end, + %% Return all the available dep directories for process {ok, NewConfig, dep_dirs(NonRawAvailableDeps)} end.