Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 370350 Details for
Bug 501250
eclass git-r3 fails while fetching git submodules with relative URLs
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to canonize relative URLs of submodules to not contain ../ or ./
git-r3.eclass.patch (text/plain), 1.44 KB, created by
Jan Huwald
on 2014-02-13 21:17:20 UTC
(
hide
)
Description:
Patch to canonize relative URLs of submodules to not contain ../ or ./
Filename:
MIME Type:
Creator:
Jan Huwald
Created:
2014-02-13 21:17:20 UTC
Size:
1.44 KB
patch
obsolete
>diff --git a/git-r3.eclass b/git-r3.eclass >index 0341972..868bce2 100644 >--- a/git-r3.eclass >+++ b/git-r3.eclass >@@ -368,6 +368,22 @@ _git-r3_is_local_repo() { > [[ ${uri} == file://* || ${uri} == /* ]] > } > >+# @FUNCTION: _git-r3_canonize_url >+# @USAGE: <uri> >+# @INTERNAL >+# @DESCRIPTION: >+# Removes ../ and ./ from paths so that the location pointed at >+# remains the same. >+_git-r3_canonize_url() { >+ new="$1" >+ while [[ "$old" != "$new" ]]; do >+ old="$new" >+ new=$(echo "$old" | sed 's!/\([^/][^/]*\)/\.\.!! >+ s!//\./!/!') >+ done >+ echo "$new" >+} >+ > # @FUNCTION: git-r3_fetch > # @USAGE: [<repo-uri> [<remote-ref> [<local-id>]]] > # @DESCRIPTION: >@@ -534,9 +550,12 @@ git-r3_fetch() { > die "Unable to get commit id for submodule ${subname}" > fi > if [[ ${url} == ./* || ${url} == ../* ]]; then >- local subrepos=( "${repos[@]/%//${url}}" ) >+ local subrepos=( ) >+ for i in "${repos[@]/%/\/${url}}"; do >+ subrepos=("${subrepos[@]}" $(_git-r3_canonize_url "$i")) >+ done > else >- local subrepos=( "${url}" ) >+ subrepos=("${url}") > fi > > git-r3_fetch "${subrepos[*]}" "${commit}" "${local_id}/${subname}" >@@ -655,7 +674,7 @@ git-r3_checkout() { > local path=${submodules[2]} > > if [[ ${url} == ./* || ${url} == ../* ]]; then >- url=${repos[0]%%/}/${url} >+ url="$(_git-r3_canonize_url "${repos[0]%%/}/${url}")" > fi > > git-r3_checkout "${url}" "${GIT_WORK_TREE}/${path}" \
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 501250
:
370350
|
370352
|
370364