commit:     ef041685437e59103d06f3e28a9a233d7a33728f
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 15 16:13:41 2017 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Sun Jan 15 16:13:59 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ef041685

net-libs/liboping: Call fcaps only on files we really have installed (bug 
#605768)

Package-Manager: Portage-2.3.3, Repoman-2.3.1

 net-libs/liboping/liboping-1.8.0-r1.ebuild | 19 ++++++++++++++-----
 net-libs/liboping/liboping-1.9.0.ebuild    | 19 ++++++++++++++-----
 2 files changed, 28 insertions(+), 10 deletions(-)

diff --git a/net-libs/liboping/liboping-1.8.0-r1.ebuild 
b/net-libs/liboping/liboping-1.8.0-r1.ebuild
index 1414754..268c953 100644
--- a/net-libs/liboping/liboping-1.8.0-r1.ebuild
+++ b/net-libs/liboping/liboping-1.8.0-r1.ebuild
@@ -52,13 +52,22 @@ src_install() {
 pkg_postinst() {
        if use filecaps; then
                local _caps_str="CAP_NET_RAW"
-               fcaps "${_caps_str}" \
-                       "${EROOT%/}/usr/bin/oping" \
-                       "${EROOT%/}/usr/bin/noping"
+               _files=( "${EROOT%/}/usr/bin/oping")
+
+               if use ncurses; then
+                       _files+=( "${EROOT%/}/usr/bin/noping")
+               fi
+
+               fcaps "${_caps_str}" "${_files[@]}"
+
                elog "Capabilities for"
                elog ""
-               elog "  ${EROOT%/}/usr/bin/oping"
-               elog "  ${EROOT%/}/usr/bin/oping"
+
+               local _file=
+               for _file in "${_files[@]}"; do
+                       elog "  ${_file}"
+               done
+
                elog ""
                elog "set to ${_caps_str}+EP due to set 'filecaps' USE flag."
                elog

diff --git a/net-libs/liboping/liboping-1.9.0.ebuild 
b/net-libs/liboping/liboping-1.9.0.ebuild
index 1414754..268c953 100644
--- a/net-libs/liboping/liboping-1.9.0.ebuild
+++ b/net-libs/liboping/liboping-1.9.0.ebuild
@@ -52,13 +52,22 @@ src_install() {
 pkg_postinst() {
        if use filecaps; then
                local _caps_str="CAP_NET_RAW"
-               fcaps "${_caps_str}" \
-                       "${EROOT%/}/usr/bin/oping" \
-                       "${EROOT%/}/usr/bin/noping"
+               _files=( "${EROOT%/}/usr/bin/oping")
+
+               if use ncurses; then
+                       _files+=( "${EROOT%/}/usr/bin/noping")
+               fi
+
+               fcaps "${_caps_str}" "${_files[@]}"
+
                elog "Capabilities for"
                elog ""
-               elog "  ${EROOT%/}/usr/bin/oping"
-               elog "  ${EROOT%/}/usr/bin/oping"
+
+               local _file=
+               for _file in "${_files[@]}"; do
+                       elog "  ${_file}"
+               done
+
                elog ""
                elog "set to ${_caps_str}+EP due to set 'filecaps' USE flag."
                elog

Reply via email to