• [gentoo-dev] [PATCH] git-r3.eclass: Add checkout dirs as "safe" directo

    From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Sun Nov 6 12:10:01 2022
    Mark all checkout directories as "safe" to avoid dubious ownership
    errors with newer git versions when the checkout directory is accessed
    from src_install().

    Bug: https://bugs.gentoo.org/879353
    Signed-off-by: Michał Górny <mgorny@gentoo.org>
    ---
    eclass/git-r3.eclass | 5 +++++
    1 file changed, 5 insertions(+)

    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
    --
    2.38.1

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)