sys-apps/sandbox: Fix REPLACING_VERSIONS use
authorMichał Górny <mgorny@gentoo.org>
Tue, 3 Oct 2017 18:26:47 +0000 (20:26 +0200)
committerMichał Górny <mgorny@gentoo.org>
Tue, 3 Oct 2017 19:09:26 +0000 (21:09 +0200)
Closes: https://bugs.gentoo.org/589518

sys-apps/sandbox/sandbox-2.12.ebuild

index 77ad8b92e125356bed8a49e5ca1511c70969f2e0..6bea9b71911753d5726b21b860ddb1bded98866e 100644 (file)
@@ -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
 }