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: Mon, 07 Nov 2022 13:26:33
Message-Id: 1667827531.207a50da440b7c6bea060972a7684e792c2a84fc.mgorny@gentoo
1 commit: 207a50da440b7c6bea060972a7684e792c2a84fc
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sun Nov 6 07:32:48 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Mon Nov 7 13:25:31 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=207a50da
7
8 git-r3.eclass: Add checkout dirs as "safe" directories
9
10 Mark all checkout directories as "safe" to avoid dubious ownership
11 errors with newer git versions when the checkout directory is accessed
12 from src_install().
13
14 Closes: https://bugs.gentoo.org/879353
15 Closes: https://github.com/gentoo/gentoo/pull/28154
16 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
17
18 eclass/git-r3.eclass | 5 +++++
19 1 file changed, 5 insertions(+)
20
21 diff --git a/eclass/git-r3.eclass b/eclass/git-r3.eclass
22 index 59d4f9a0038f..bdb28565e2f9 100644
23 --- a/eclass/git-r3.eclass
24 +++ b/eclass/git-r3.eclass
25 @@ -887,6 +887,11 @@ git-r3_checkout() {
26 cp "${orig_repo}"/packed-refs "${GIT_DIR}"/packed-refs || die
27 fi
28
29 + # mark this directory as "safe" so that src_install() can access it
30 + # https://bugs.gentoo.org/879353
31 + git config --global --add safe.directory \
32 + "$(cd "${out_dir}" && echo "${PWD}")" || die
33 +
34 # (no need to copy HEAD, we will set it via checkout)
35
36 if [[ -f ${orig_repo}/shallow ]]; then