commit:     2ccc67364d5ba5626356342a5d390dd4e65b63e0
Author:     David Sardari <d <AT> duxsco <DOT> de>
AuthorDate: Tue Jan 21 20:28:39 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jan 21 21:02:35 2025 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=2ccc6736

emerge-webrsync: Change repo folder ownership if FEATURES=usersync

Bug: https://bugs.gentoo.org/707980
Signed-off-by: David Sardari <d <AT> duxsco.de>
Closes: https://github.com/gentoo/portage/pull/1390
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/emerge-webrsync | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index c135fd9c62..3a9ee03984 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -697,7 +697,14 @@ main() {
 
        handle_pgp_setup
 
-       [[ -d ${repo_location} ]] || mkdir -p "${repo_location}"
+       if [[ ! -d ${repo_location} ]]; then
+               mkdir -p "${repo_location}" || die
+
+               if has usersync ${FEATURES} ; then
+                       chown "${PORTAGE_USERNAME}":"${PORTAGE_GRPNAME}" 
"${repo_location}" || die
+               fi
+       fi
+
        if [[ ! -w ${repo_location} ]] ; then
                die "Repository '${repo_name}' is not writable: 
${repo_location}"
        fi

Reply via email to