diff options
Diffstat (limited to 'app-eselect/eselect-opengl')
-rw-r--r-- | app-eselect/eselect-opengl/eselect-opengl-1.3.1-r4.ebuild | 10 |
1 files 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 1206be17c265..d3f04c9469cb 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 |