Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Wed, 25 Jan 2017 13:24:15
Message-Id: 1485350644.eb4c42b20e78f3577ea26a028ff92393e2c4a2ff.mgorny@gentoo
1 commit: eb4c42b20e78f3577ea26a028ff92393e2c4a2ff
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jan 25 13:22:17 2017 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Wed Jan 25 13:24:04 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=eb4c42b2
7
8 git-r3.eclass: Escape all weird chars in submodule names, #606950
9
10 eclass/git-r3.eclass | 9 +++++----
11 1 file changed, 5 insertions(+), 4 deletions(-)
12
13 diff --git a/eclass/git-r3.eclass b/eclass/git-r3.eclass
14 index f76f1a7..d105e50 100644
15 --- a/eclass/git-r3.eclass
16 +++ b/eclass/git-r3.eclass
17 @@ -447,10 +447,11 @@ _git-r3_set_submodules() {
18 submodule."${subname}".update)
19 [[ ${upd} == none ]] && continue
20
21 - # https://github.com/git/git/blob/master/refs.c#L39
22 - # for now, we just filter /. because of #572312
23 - local enc_subname=${subname//\/.//_}
24 - [[ ${enc_subname} == .* ]] && enc_subname=_${enc_subname#.}
25 + # https://github.com/git/git/blob/master/refs.c#L31
26 + # we are more restrictive than git itself but that should not
27 + # cause any issues, #572312, #606950
28 + # TODO: check escaped names for collisions
29 + local enc_subname=${subname//[^a-zA-Z0-9-]/_}
30
31 submodules+=(
32 "${enc_subname}"