diff options
author | Michał Górny <mgorny@gentoo.org> | 2015-07-09 20:21:05 +0000 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2015-07-09 20:21:05 +0000 |
commit | 2dce4541eef093f44ada7a3a59abc5739dff7f44 (patch) | |
tree | 6ad9fe90c5df060af6945e2429800afb56b666bf /eclass | |
parent | Use SLOT operator for openssl. (diff) | |
download | gentoo-2-2dce4541eef093f44ada7a3a59abc5739dff7f44.tar.gz gentoo-2-2dce4541eef093f44ada7a3a59abc5739dff7f44.tar.bz2 gentoo-2-2dce4541eef093f44ada7a3a59abc5739dff7f44.zip |
Do not attempt to use submodules for which the checkout path does not exist (has been removed), bug #551100.
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/ChangeLog | 6 | ||||
-rw-r--r-- | eclass/git-r3.eclass | 36 |
2 files changed, 29 insertions, 13 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog index b6c94b4583eb..44a94ded7ce4 100644 --- a/eclass/ChangeLog +++ b/eclass/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for eclass directory # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1706 2015/07/09 15:43:03 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1707 2015/07/09 20:21:05 mgorny Exp $ + + 09 Jul 2015; Michał Górny <mgorny@gentoo.org> git-r3.eclass: + Do not attempt to use submodules for which the checkout path does not exist + (has been removed), bug #551100. 09 Jul 2015; Michał Górny <mgorny@gentoo.org> gnome2.eclass: Remove meaningless nonfatal from elibtoolize call, bug #551154. diff --git a/eclass/git-r3.eclass b/eclass/git-r3.eclass index eca443bce14c..ba7715df604b 100644 --- a/eclass/git-r3.eclass +++ b/eclass/git-r3.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/git-r3.eclass,v 1.49 2015/06/22 08:39:36 mrueg Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/git-r3.eclass,v 1.50 2015/07/09 20:21:05 mgorny Exp $ # @ECLASS: git-r3.eclass # @MAINTAINER: @@ -710,16 +710,23 @@ git-r3_fetch() { local subname=${submodules[0]} local url=${submodules[1]} local path=${submodules[2]} - local commit=$(git rev-parse "${local_ref}:${path}") - if [[ ! ${commit} ]]; then - die "Unable to get commit id for submodule ${subname}" - fi + # use only submodules for which path does exist + # (this is in par with 'git submodule'), bug #551100 + # note: git cat-file does not work for submodules + if [[ $(git ls-tree -d "${local_ref}" "${path}") ]] + then + local commit=$(git rev-parse "${local_ref}:${path}" || die) - local subrepos - _git-r3_set_subrepos "${url}" "${repos[@]}" + if [[ ! ${commit} ]]; then + die "Unable to get commit id for submodule ${subname}" + fi - git-r3_fetch "${subrepos[*]}" "${commit}" "${local_id}/${subname}" + local subrepos + _git-r3_set_subrepos "${url}" "${repos[@]}" + + git-r3_fetch "${subrepos[*]}" "${commit}" "${local_id}/${subname}" + fi submodules=( "${submodules[@]:3}" ) # shift done @@ -849,11 +856,16 @@ git-r3_checkout() { local subname=${submodules[0]} local url=${submodules[1]} local path=${submodules[2]} - local subrepos - _git-r3_set_subrepos "${url}" "${repos[@]}" - git-r3_checkout "${subrepos[*]}" "${out_dir}/${path}" \ - "${local_id}/${subname}" + # use only submodules for which path does exist + # (this is in par with 'git submodule'), bug #551100 + if [[ -d ${out_dir}/${path} ]]; then + local subrepos + _git-r3_set_subrepos "${url}" "${repos[@]}" + + git-r3_checkout "${subrepos[*]}" "${out_dir}/${path}" \ + "${local_id}/${subname}" + fi submodules=( "${submodules[@]:3}" ) # shift done |