commit:     0e75df216fd02d70c32ce8cac8b52690f879566f
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Oct  3 18:26:47 2017 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Oct  3 19:09:26 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0e75df21

sys-apps/sandbox: Fix REPLACING_VERSIONS use

Closes: https://bugs.gentoo.org/589518

 sys-apps/sandbox/sandbox-2.12.ebuild | 24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/sys-apps/sandbox/sandbox-2.12.ebuild 
b/sys-apps/sandbox/sandbox-2.12.ebuild
index 77ad8b92e12..6bea9b71911 100644
--- a/sys-apps/sandbox/sandbox-2.12.ebuild
+++ b/sys-apps/sandbox/sandbox-2.12.ebuild
@@ -54,17 +54,23 @@ pkg_preinst() {
        chown root:portage "${ED}"/var/log/sandbox
        chmod 0770 "${ED}"/var/log/sandbox
 
-       if [[ ${REPLACING_VERSIONS} == 1.* ]] ; then
-               local old=$(find "${EROOT}"/lib* -maxdepth 1 -name 
'libsandbox*')
-               if [[ -n ${old} ]] ; then
-                       elog "Removing old sandbox libraries for you:"
-                       find "${EROOT}"/lib* -maxdepth 1 -name 'libsandbox*' 
-print -delete
+       local v
+       for v in ${REPLACING_VERSIONS}; do
+               if [[ ${v} == 1.* ]] ; then
+                       local old=$(find "${EROOT}"/lib* -maxdepth 1 -name 
'libsandbox*')
+                       if [[ -n ${old} ]] ; then
+                               elog "Removing old sandbox libraries for you:"
+                               find "${EROOT}"/lib* -maxdepth 1 -name 
'libsandbox*' -print -delete
+                       fi
                fi
-       fi
+       done
 }
 
 pkg_postinst() {
-       if [[ ${REPLACING_VERSIONS} == 1.* ]] ; then
-               chmod 0755 "${EROOT}"/etc/sandbox.d #265376
-       fi
+       local v
+       for v in ${REPLACING_VERSIONS}; do
+               if [[ ${v} == 1.* ]] ; then
+                       chmod 0755 "${EROOT}"/etc/sandbox.d #265376
+               fi
+       done
 }

Reply via email to