commit:     a4c4394579b56009954e476af1ba3f5fa1ad58d8
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 15 09:45:44 2020 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Nov 15 10:12:55 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a4c43945

media-gfx/xsane: Use relative symlink, fix ugly shell code

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 media-gfx/xsane/xsane-0.999-r3.ebuild | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/media-gfx/xsane/xsane-0.999-r3.ebuild 
b/media-gfx/xsane/xsane-0.999-r3.ebuild
index 21fc69c4858..08d3756194f 100644
--- a/media-gfx/xsane/xsane-0.999-r3.ebuild
+++ b/media-gfx/xsane/xsane-0.999-r3.ebuild
@@ -76,14 +76,14 @@ src_install() {
        # link xsane so it is seen as a plugin in gimp
        if use gimp; then
                local plugindir
-               local gimptool=$(ls "${EPREFIX}"/usr/bin/gimptool* | head -n1)
-               if [ -n "${gimptool}" ]; then
-                       plugindir="$(${gimptool} --gimpplugindir)/plug-ins"
+               local gimptool=( "${EPREFIX}"/usr/bin/gimptool* )
+               if [[ ${#gimptool[@]} -gt 0 ]]; then
+                       plugindir="$("${gimptool[0]}" --gimpplugindir)/plug-ins"
                else
                        die "Can't find GIMP plugin directory."
                fi
-               dodir "${plugindir#${EPREFIX}}"
-               dosym "${EPREFIX}/usr/bin/xsane" "${plugindir#${EPREFIX}}"/xsane
+               mkdir -p "${D}${plugindir}" || die
+               ln -s ../../../../bin/xsane "${D}${plugindir}"/xsane || die
        fi
 
        newicon "${DISTDIR}/${PN}-256x256.png" "${PN}".png

Reply via email to