summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2022-11-06 08:32:48 +0100
committerMichał Górny <mgorny@gentoo.org>2022-11-07 14:25:31 +0100
commit207a50da440b7c6bea060972a7684e792c2a84fc (patch)
tree0cb3ad9b28015332da324749569a3d2bdec58e40 /eclass
parentdev-python/psycopg: Remove old (diff)
downloadgentoo-207a50da440b7c6bea060972a7684e792c2a84fc.tar.gz
gentoo-207a50da440b7c6bea060972a7684e792c2a84fc.tar.bz2
gentoo-207a50da440b7c6bea060972a7684e792c2a84fc.zip
git-r3.eclass: Add checkout dirs as "safe" directories
Mark all checkout directories as "safe" to avoid dubious ownership errors with newer git versions when the checkout directory is accessed from src_install(). Closes: https://bugs.gentoo.org/879353 Closes: https://github.com/gentoo/gentoo/pull/28154 Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/git-r3.eclass5
1 files changed, 5 insertions, 0 deletions
diff --git a/eclass/git-r3.eclass b/eclass/git-r3.eclass
index 59d4f9a0038f..bdb28565e2f9 100644
--- a/eclass/git-r3.eclass
+++ b/eclass/git-r3.eclass
@@ -887,6 +887,11 @@ git-r3_checkout() {
cp "${orig_repo}"/packed-refs "${GIT_DIR}"/packed-refs || die
fi
+ # mark this directory as "safe" so that src_install() can access it
+ # https://bugs.gentoo.org/879353
+ git config --global --add safe.directory \
+ "$(cd "${out_dir}" && echo "${PWD}")" || die
+
# (no need to copy HEAD, we will set it via checkout)
if [[ -f ${orig_repo}/shallow ]]; then