commit:     20662b9aa58fe14d123fccf9b8c4e0d4bb44b508
Author:     Chema Alonso Josa <nimiux <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 22 21:34:16 2017 +0000
Commit:     José María Alonso <nimiux <AT> gentoo <DOT> org>
CommitDate: Tue Aug 22 21:34:16 2017 +0000
URL:        https://gitweb.gentoo.org/proj/lisp.git/commit/?id=20662b9a

git-r3.eclass: Syncs with ebuild repository

 eclass/git-r3.eclass | 26 +++++++++++---------------
 1 file changed, 11 insertions(+), 15 deletions(-)

diff --git a/eclass/git-r3.eclass b/eclass/git-r3.eclass
index f76f1a7e..bc7d4d92 100644
--- a/eclass/git-r3.eclass
+++ b/eclass/git-r3.eclass
@@ -1,6 +1,5 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Id$
 
 # @ECLASS: git-r3.eclass
 # @MAINTAINER:
@@ -18,12 +17,6 @@ case "${EAPI:-0}" in
                ;;
 esac
 
-if [[ ! ${_GIT_R3} ]]; then
-
-inherit eutils
-
-fi
-
 EXPORT_FUNCTIONS src_unpack
 
 if [[ ! ${_GIT_R3} ]]; then
@@ -154,8 +147,9 @@ fi
 # @DEFAULT_UNSET
 # @DESCRIPTION:
 # The tag name or commit identifier to check out. If unset, newest
-# commit from the branch will be used. If set, EGIT_BRANCH will
-# be ignored.
+# commit from the branch will be used. Note that if set to a commit
+# not on HEAD branch, EGIT_BRANCH needs to be set to a branch on which
+# the commit is available.
 #
 # It can be overriden via env using ${PN}_LIVE_COMMIT variable.
 
@@ -163,7 +157,8 @@ fi
 # @DEFAULT_UNSET
 # @DESCRIPTION:
 # Attempt to check out the repository state for the specified timestamp.
-# The date should be in format understood by 'git rev-list'.
+# The date should be in format understood by 'git rev-list'. The commits
+# on EGIT_BRANCH will be considered.
 #
 # The eclass will select the last commit with commit date preceding
 # the specified date. When merge commits are found, only first parents
@@ -447,10 +442,11 @@ _git-r3_set_submodules() {
                        submodule."${subname}".update)
                [[ ${upd} == none ]] && continue
 
-               # https://github.com/git/git/blob/master/refs.c#L39
-               # for now, we just filter /. because of #572312
-               local enc_subname=${subname//\/.//_}
-               [[ ${enc_subname} == .* ]] && enc_subname=_${enc_subname#.}
+               # https://github.com/git/git/blob/master/refs.c#L31
+               # we are more restrictive than git itself but that should not
+               # cause any issues, #572312, #606950
+               # TODO: check escaped names for collisions
+               local enc_subname=${subname//[^a-zA-Z0-9-]/_}
 
                submodules+=(
                        "${enc_subname}"

Reply via email to