Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 501250 | Differences between
and this patch

Collapse All | Expand All

(-)a/git-r3.eclass.bak_by_hu (-2 / +22 lines)
Lines 368-373 _git-r3_is_local_repo() { Link Here
368
	[[ ${uri} == file://* || ${uri} == /* ]]
368
	[[ ${uri} == file://* || ${uri} == /* ]]
369
}
369
}
370
370
371
# @FUNCTION: _git-r3_canonize_url
372
# @USAGE: <uri>
373
# @INTERNAL
374
# @DESCRIPTION:
375
# Removes ../ and ./ from paths so that the location pointed at
376
# remains the same.
377
_git-r3_canonize_url() {
378
	new="$1"
379
	shopt -s extglob
380
	while [[ "$old" != "$new" ]]; do
381
		old="$new"
382
		new="${old/+([^\/])\/..\//}" # collapse dir/../ to /
383
		new="${new/\/.\///}"         # collapse /./ to /
384
	done
385
	echo "$new"
386
}
387
371
# @FUNCTION: git-r3_fetch
388
# @FUNCTION: git-r3_fetch
372
# @USAGE: [<repo-uri> [<remote-ref> [<local-id>]]]
389
# @USAGE: [<repo-uri> [<remote-ref> [<local-id>]]]
373
# @DESCRIPTION:
390
# @DESCRIPTION:
Lines 534-540 git-r3_fetch() { Link Here
534
				die "Unable to get commit id for submodule ${subname}"
551
				die "Unable to get commit id for submodule ${subname}"
535
			fi
552
			fi
536
			if [[ ${url} == ./* || ${url} == ../* ]]; then
553
			if [[ ${url} == ./* || ${url} == ../* ]]; then
537
				local subrepos=( "${repos[@]/%//${url}}" )
554
				local subrepos=( )
555
				for i in "${repos[@]/%/\/${url}}"; do
556
					subrepos=("${subrepos[@]}" $(_git-r3_canonize_url "$i"))
557
				done
538
			else
558
			else
539
				local subrepos=( "${url}" )
559
				local subrepos=( "${url}" )
540
			fi
560
			fi
Lines 655-661 git-r3_checkout() { Link Here
655
			local path=${submodules[2]}
675
			local path=${submodules[2]}
656
676
657
			if [[ ${url} == ./* || ${url} == ../* ]]; then
677
			if [[ ${url} == ./* || ${url} == ../* ]]; then
658
				url=${repos[0]%%/}/${url}
678
				url="$(_git-r3_canonize_url "${repos[0]%%/}/${url}")"
659
			fi
679
			fi
660
680
661
			git-r3_checkout "${url}" "${GIT_WORK_TREE}/${path}" \
681
			git-r3_checkout "${url}" "${GIT_WORK_TREE}/${path}" \

Return to bug 501250