Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 370364 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 ./ - version 2
git-r3.eclass.patch (text/plain), 1.37 KB, created by
Jan Huwald
on 2014-02-13 22:05:55 UTC
(
hide
)
Description:
Patch to canonize relative URLs of submodules to not contain ../ or ./ - version 2
Filename:
MIME Type:
Creator:
Jan Huwald
Created:
2014-02-13 22:05:55 UTC
Size:
1.37 KB
patch
obsolete
>diff --git a/git-r3.eclass.bak_by_hu b/git-r3.eclass >index 0341972..e9a4003 100644 >--- a/git-r3.eclass.bak_by_hu >+++ b/git-r3.eclass >@@ -368,6 +368,23 @@ _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" >+ shopt -s extglob >+ while [[ "$old" != "$new" ]]; do >+ old="$new" >+ new="${old/+([^\/])\/..\//}" # collapse dir/../ to / >+ new="${new/\/.\///}" # collapse /./ to / >+ done >+ echo "$new" >+} >+ > # @FUNCTION: git-r3_fetch > # @USAGE: [<repo-uri> [<remote-ref> [<local-id>]]] > # @DESCRIPTION: >@@ -534,7 +551,10 @@ 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}" ) > fi >@@ -655,7 +675,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