commit:     8101ca1cbc0ff4bb763fa524864d9864b30db910
Author:     Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Sun Feb  3 05:40:13 2019 +0000
Commit:     Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Tue Feb  5 19:22:00 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8101ca1c

opam.eclass: unbreak on EAPI=7

Since D, ED, ROOT, EROOT no longer have a trailing slash in EAPI=7
This eclass is terribly broken, installing things into
imageusr/...

Reported by AnAverageHuman on #gentoo-dev-help

Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>

 eclass/opam.eclass | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/eclass/opam.eclass b/eclass/opam.eclass
index 5c9c4950dd2..03ffc027641 100644
--- a/eclass/opam.eclass
+++ b/eclass/opam.eclass
@@ -30,10 +30,10 @@ opam-install() {
        local pkg
        for pkg ; do
                opam-installer -i \
-                       --prefix="${ED}usr" \
-                       --libdir="${D}$(ocamlc -where)" \
-                       --docdir="${ED}usr/share/doc/${PF}" \
-                       --mandir="${ED}usr/share/man" \
+                       --prefix="${ED%/}/usr" \
+                       --libdir="${D%/}/$(ocamlc -where)" \
+                       --docdir="${ED%/}/usr/share/doc/${PF}" \
+                       --mandir="${ED%/}/usr/share/man" \
                        "${pkg}.install" || die
        done
 }
@@ -42,9 +42,9 @@ opam_src_install() {
        local pkg="${1:-${PN}}"
        opam-install "${pkg}"
        # Handle opam putting doc in a subdir
-       if [ -d "${ED}usr/share/doc/${PF}/${pkg}" ] ; then
-               mv "${ED}usr/share/doc/${PF}/${pkg}/"* 
"${ED}usr/share/doc/${PF}/" || die
-               rmdir "${ED}usr/share/doc/${PF}/${pkg}" || die
+       if [ -d "${ED%/}/usr/share/doc/${PF}/${pkg}" ] ; then
+               mv "${ED%/}/usr/share/doc/${PF}/${pkg}/"* 
"${ED%/}/usr/share/doc/${PF}/" || die
+               rmdir "${ED%/}/usr/share/doc/${PF}/${pkg}" || die
        fi
 }
 

Reply via email to