diff options
author | Michał Górny <mgorny@gentoo.org> | 2018-08-09 16:49:40 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2018-08-15 09:30:58 +0200 |
commit | fc5c1a6da74717d486a77d42c9c5b52977719c5d (patch) | |
tree | 6537884502c32dad8b20b5f3c7f28830b92f01f4 /app-eselect/eselect-opengl | |
parent | www-apps/postfixadmin: Replace path_exists with inline logic (diff) | |
download | gentoo-fc5c1a6da74717d486a77d42c9c5b52977719c5d.tar.gz gentoo-fc5c1a6da74717d486a77d42c9c5b52977719c5d.tar.bz2 gentoo-fc5c1a6da74717d486a77d42c9c5b52977719c5d.zip |
app-eselect/eselect-opengl: Replace path_exists
Replace path_exists call with nullglob-based filename expansion.
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 |