eclass: uprev fcaps.eclass to latest upstream version

Uprev fcaps.eclass to latest gentoo upstream version.

BUG=None
TEST=`cbuildbot chromiumos-sdk {x86-alex,stumpy}-release` works

Change-Id: Id6d72d106e7b5648d45c7e603ee4365d7884aea6
Reviewed-on: https://chromium-review.googlesource.com/266221
Tested-by: Samuel Tan <samueltan@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Samuel Tan <samueltan@chromium.org>
diff --git a/eclass/fcaps.eclass b/eclass/fcaps.eclass
index 76f3c35..8595caa 100644
--- a/eclass/fcaps.eclass
+++ b/eclass/fcaps.eclass
@@ -1,6 +1,6 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/fcaps.eclass,v 1.8 2013/06/27 01:18:57 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/fcaps.eclass,v 1.11 2015/02/18 16:11:53 vapier Exp $
 
 # @ECLASS: fcaps.eclass
 # @MAINTAINER:
@@ -9,6 +9,8 @@
 # @BLURB: function to set POSIX file-based capabilities
 # @DESCRIPTION:
 # This eclass provides a function to set file-based capabilities on binaries.
+# This is not the same as USE=caps which controls runtime capability changes,
+# often via packages like libcap.
 #
 # Due to probable capability-loss on moving or copying, this happens in
 # pkg_postinst-phase (at least for now).
@@ -28,8 +30,8 @@
 # )
 # @CODE
 
-if [[ ${___ECLASS_ONCE_FCAPS} != "recur -_+^+_- spank" ]] ; then
-___ECLASS_ONCE_FCAPS="recur -_+^+_- spank"
+if [[ -z ${_FCAPS_ECLASS} ]]; then
+_FCAPS_ECLASS=1
 
 IUSE="+filecaps"
 
@@ -73,14 +75,14 @@
 #
 # If the system is unable to set capabilities, it will use the specified user,
 # group, and mode (presumably to make the binary set*id).  The defaults there
-# are root:root and 4711.  Otherwise, the ownership and permissions will be
+# are root:0 and 4711.  Otherwise, the ownership and permissions will be
 # unchanged.
 fcaps() {
 	debug-print-function ${FUNCNAME} "$@"
 
 	# Process the user options first.
 	local owner='root'
-	local group='root'
+	local group='0'
 	local mode='4711'
 	local caps_mode='711'
 
@@ -182,8 +184,8 @@
 					continue 2
 				fi
 			done
-			if [[ ${notfound} -eq 2 ]] && [[ -z ${__FCAPS_WARNED} ]] ; then
-				__FCAPS_WARNED="true"
+			if [[ ${notfound} -eq 2 ]] && [[ -z ${_FCAPS_WARNED} ]] ; then
+				_FCAPS_WARNED="true"
 				ewarn "Could not find cap utils; make sure libcap or libcap-ng is available."
 			fi
 		fi