1 |
On Mon, 23 May 2016 22:06:03 +0200 |
2 |
Patrice Clement <monsieurp@g.o> wrote: |
3 |
|
4 |
> Monday 23 May 2016 21:54:19, Michał Górny wrote : |
5 |
> > --- |
6 |
> > eclass/git-r3.eclass | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++- |
7 |
> > 1 file changed, 52 insertions(+), 1 deletion(-) |
8 |
> > |
9 |
> > diff --git a/eclass/git-r3.eclass b/eclass/git-r3.eclass |
10 |
> > index 957ff08..61218a8 100644 |
11 |
> > --- a/eclass/git-r3.eclass |
12 |
> > +++ b/eclass/git-r3.eclass |
13 |
> > @@ -165,6 +165,36 @@ fi |
14 |
> > # |
15 |
> > # EGIT_CHECKOUT_DIR=${WORKDIR}/${P} |
16 |
> > |
17 |
> > +# @ECLASS-VARIABLE: EGIT_SUBMODULES |
18 |
> > +# @DEFAULT_UNSET |
19 |
> > +# @DESCRIPTION: |
20 |
> > +# An array of inclusive and exclusive wildcards on submodule names, |
21 |
> > +# stating which submodules are fetched and checked out. Exclusions |
22 |
> > +# start with '-', and exclude previously matched submodules. |
23 |
> > +# |
24 |
> > +# If unset, all submodules are enabled. Empty list disables all |
25 |
> > +# submodules. In order to use an exclude-only list, start the array |
26 |
> > +# with '*'. |
27 |
> > +# |
28 |
> > +# Remember that wildcards need to be quoted in order to prevent filename |
29 |
> > +# expansion. |
30 |
> > +# |
31 |
> > +# Examples: |
32 |
> > +# @CODE |
33 |
> > +# # Disable all submodules |
34 |
> > +# EGIT_SUBMODULES=() |
35 |
> > +# |
36 |
> > +# # Include only foo and bar |
37 |
> > +# EGIT_SUBMODULES=( foo bar ) |
38 |
> > +# |
39 |
> > +# # Use all submodules except for test-* but include test-lib |
40 |
> > +# EGIT_SUBMODULES=( '*' '-test-*' test-lib ) |
41 |
> > +# @CODE |
42 |
> > +if [[ ${EGIT_SUBMODULES[@]+1} && $(declare -p EGIT_SUBMODULES) != "declare -a"* ]] |
43 |
> > +then |
44 |
> > + die 'EGIT_SUBMODULES must be an array.' |
45 |
> > +fi |
46 |
> > + |
47 |
> > # @FUNCTION: _git-r3_env_setup |
48 |
> > # @INTERNAL |
49 |
> > # @DESCRIPTION: |
50 |
> > @@ -243,7 +273,8 @@ _git-r3_env_setup() { |
51 |
> > if [[ ${EGIT_HAS_SUBMODULES} ]]; then |
52 |
> > eerror "EGIT_HAS_SUBMODULES has been removed. The eclass no longer needs" |
53 |
> > eerror "to switch the clone type in order to support submodules and therefore" |
54 |
> > - eerror "submodules are detected and fetched automatically." |
55 |
> > + eerror "submodules are detected and fetched automatically. If you need to" |
56 |
> > + eerror "disable or filter submodules, see EGIT_SUBMODULES." |
57 |
> > die "EGIT_HAS_SUBMODULES is no longer necessary." |
58 |
> > fi |
59 |
> > |
60 |
> > @@ -357,6 +388,26 @@ _git-r3_set_submodules() { |
61 |
> > l=${l#submodule.} |
62 |
> > local subname=${l%%.url=*} |
63 |
> > |
64 |
> > + # filter out on EGIT_SUBMODULES |
65 |
> > + if declare -p EGIT_SUBMODULES &>/dev/null; then |
66 |
> > + local p res= l_res |
67 |
> |
68 |
> Watch out for the extra space. |
69 |
|
70 |
Just moved through the line back and forth in vim and I don't see any |
71 |
extra space... |
72 |
|
73 |
-- |
74 |
Best regards, |
75 |
Michał Górny |
76 |
<http://dev.gentoo.org/~mgorny/> |