commit:     934685cc74127d88bb1dd17a479ce50cca20427c
Author:     Benda Xu <heroxbd <AT> gentoo <DOT> org>
AuthorDate: Sun Mar  8 04:14:53 2020 +0000
Commit:     Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Mon Mar 16 02:23:55 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=934685cc

fcaps.eclass: skip fcaps() on Prefix.

Gentoo Prefix runs with a normal user and cannot grant extra
capabilities.  Exit gracefully with a message.

Reference: 
https://archives.gentoo.org/gentoo-dev/message/4207cffd6b875450bb2fdbcf1b076053
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>

 eclass/fcaps.eclass | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/eclass/fcaps.eclass b/eclass/fcaps.eclass
index 2b6e5be4683..0bb23f8cca7 100644
--- a/eclass/fcaps.eclass
+++ b/eclass/fcaps.eclass
@@ -81,6 +81,11 @@ esac
 fcaps() {
        debug-print-function ${FUNCNAME} "$@"
 
+       if [[ ${EUID} != 0 ]] ; then
+               einfo "Insufficient privileges to execute ${FUNCNAME}, 
skipping."
+               return 0
+       fi
+
        # Process the user options first.
        local owner='root'
        local group='0'

Reply via email to