commit:     fc5c1a6da74717d486a77d42c9c5b52977719c5d
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Aug  9 14:49:40 2018 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Aug 15 07:30:58 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fc5c1a6d

app-eselect/eselect-opengl: Replace path_exists

Replace path_exists call with nullglob-based filename expansion.

 app-eselect/eselect-opengl/eselect-opengl-1.3.1-r4.ebuild | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/app-eselect/eselect-opengl/eselect-opengl-1.3.1-r4.ebuild 
b/app-eselect/eselect-opengl/eselect-opengl-1.3.1-r4.ebuild
index 1206be17c26..d3f04c9469c 100644
--- a/app-eselect/eselect-opengl/eselect-opengl-1.3.1-r4.ebuild
+++ b/app-eselect/eselect-opengl/eselect-opengl-1.3.1-r4.ebuild
@@ -49,11 +49,15 @@ pkg_preinst() {
 }
 
 pkg_postinst() {
-       if path_exists "${EROOT}"/usr/lib*/opengl; then
+       local shopt_save=$(shopt -p nullglob)
+       shopt -s nullglob
+       local opengl_dirs=( "${EROOT}"/usr/lib*/opengl )
+       ${shopt_save}
+       if [[ -n ${opengl_dirs[@]} ]]; then
                # delete broken symlinks
-               find "${EROOT}"/usr/lib*/opengl -xtype l -delete
+               find "${opengl_dirs[@]}" -xtype l -delete
                # delete empty leftover directories (they confuse eselect)
-               find "${EROOT}"/usr/lib*/opengl -depth -type d -empty -exec 
rmdir -v {} +
+               find "${opengl_dirs[@]}" -depth -type d -empty -exec rmdir -v 
{} +
        fi
 
        if [[ -n "${OLD_IMPL}" && "${OLD_IMPL}" != '(none)' ]] ; then

Reply via email to