fcaps.eclass: skip fcaps() on Prefix.
authorBenda Xu <heroxbd@gentoo.org>
Sun, 8 Mar 2020 04:14:53 +0000 (12:14 +0800)
committerBenda Xu <heroxbd@gentoo.org>
Mon, 16 Mar 2020 02:23:55 +0000 (10:23 +0800)
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@gentoo.org>
eclass/fcaps.eclass

index 2b6e5be4683d7bc3793ba777871d91972b5fb3be..0bb23f8cca7094f4b7b4544db7439050aa311437 100644 (file)
@@ -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'