Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 497164
Collapse All | Expand All

(-)a/eclass/git-r3.eclass (-2 / +52 lines)
Lines 165-170 fi Link Here
165
#
165
#
166
# EGIT_CHECKOUT_DIR=${WORKDIR}/${P}
166
# EGIT_CHECKOUT_DIR=${WORKDIR}/${P}
167
167
168
# @ECLASS-VARIABLE: EGIT_SUBMODULES
169
# @DEFAULT_UNSET
170
# @DESCRIPTION:
171
# An array of inclusive and exclusive wildcards on submodule names,
172
# stating which submodules are fetched and checked out. Exclusions
173
# start with '-', and exclude previously matched submodules.
174
#
175
# If unset, all submodules are enabled. Empty list disables all
176
# submodules. In order to use an exclude-only list, start the array
177
# with '*'.
178
#
179
# Remember that wildcards need to be quoted in order to prevent filename
180
# expansion.
181
#
182
# Examples:
183
# @CODE
184
# # Disable all submodules
185
# EGIT_SUBMODULES=()
186
#
187
# # Include only foo and bar
188
# EGIT_SUBMODULES=( foo bar )
189
#
190
# # Use all submodules except for test-* but include test-lib
191
# EGIT_SUBMODULES=( '*' '-test-*' test-lib )
192
# @CODE
193
if [[ ${EGIT_SUBMODULES[@]+1} && $(declare -p EGIT_SUBMODULES) != "declare -a"* ]]
194
then
195
	die 'EGIT_SUBMODULES must be an array.'
196
fi
197
168
# @FUNCTION: _git-r3_env_setup
198
# @FUNCTION: _git-r3_env_setup
169
# @INTERNAL
199
# @INTERNAL
170
# @DESCRIPTION:
200
# @DESCRIPTION:
Lines 243-249 _git-r3_env_setup() { Link Here
243
	if [[ ${EGIT_HAS_SUBMODULES} ]]; then
273
	if [[ ${EGIT_HAS_SUBMODULES} ]]; then
244
		eerror "EGIT_HAS_SUBMODULES has been removed. The eclass no longer needs"
274
		eerror "EGIT_HAS_SUBMODULES has been removed. The eclass no longer needs"
245
		eerror "to switch the clone type in order to support submodules and therefore"
275
		eerror "to switch the clone type in order to support submodules and therefore"
246
		eerror "submodules are detected and fetched automatically."
276
		eerror "submodules are detected and fetched automatically. If you need to"
277
		eerror "disable or filter submodules, see EGIT_SUBMODULES."
247
		die "EGIT_HAS_SUBMODULES is no longer necessary."
278
		die "EGIT_HAS_SUBMODULES is no longer necessary."
248
	fi
279
	fi
249
280
Lines 357-362 _git-r3_set_submodules() { Link Here
357
		l=${l#submodule.}
388
		l=${l#submodule.}
358
		local subname=${l%%.url=*}
389
		local subname=${l%%.url=*}
359
390
391
		# filter out on EGIT_SUBMODULES
392
		if declare -p EGIT_SUBMODULES &>/dev/null; then
393
			local p res= l_res
394
			for p in "${EGIT_SUBMODULES[@]}"; do
395
				if [[ ${p} == -* ]]; then
396
					p=${p#-}
397
					l_res=
398
				else
399
					l_res=1
400
				fi
401
402
				[[ ${subname} == ${p} ]] && res=${l_res}
403
			done
404
405
			if [[ ! ${res} ]]; then
406
				einfo "Skipping submodule \e[1m${subname}\e[22m"
407
				continue
408
			fi
409
		fi
410
360
		# skip modules that have 'update = none', bug #487262.
411
		# skip modules that have 'update = none', bug #487262.
361
		local upd=$(echo "${data}" | git config -f /dev/fd/0 \
412
		local upd=$(echo "${data}" | git config -f /dev/fd/0 \
362
			submodule."${subname}".update)
413
			submodule."${subname}".update)
363
- 

Return to bug 497164