public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] opam.eclass: unbreak on EAPI=7
@ 2019-02-03  5:27 Georgy Yakovlev
  2019-02-03  5:35 ` [gentoo-dev] [PATCH] opam.eclass: check only for known EAPI, die otherwise Georgy Yakovlev
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Georgy Yakovlev @ 2019-02-03  5:27 UTC (permalink / raw
  To: gentoo-dev; +Cc: Georgy Yakovlev

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@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..ba4f515f0ec 100644
--- a/eclass/opam.eclass
+++ b/eclass/opam.eclass
@@ -1,51 +1,51 @@
 # Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: opam.eclass
 # @MAINTAINER:
 # Gentoo ML Project <ml@gentoo.org>
 # @AUTHOR:
 # Alexis Ballier <aballier@gentoo.org>
 # @SUPPORTED_EAPIS: 5 6 7
 # @BLURB: Provides functions for installing opam packages.
 # @DESCRIPTION:
 # Provides dependencies on opam and ocaml, opam-install and a default
 # src_install for opam-based packages.
 
 case ${EAPI:-0} in
     0|1|2|3|4) die "You need at least EAPI-5 to use opam.eclass";;
     *) ;;
 esac
 
 RDEPEND=">=dev-lang/ocaml-4:="
 DEPEND="${RDEPEND}
 	dev-ml/opam"
 
 # @FUNCTION: opam-install
 # @USAGE: <list of packages>
 # @DESCRIPTION:
 # Installs the opam packages given as arguments. For each "${pkg}" element in
 # that list, "${pkg}.install" must be readable from current working directory.
 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
 }
 
 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
 }
 
 EXPORT_FUNCTIONS src_install
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-dev] [PATCH] opam.eclass: check only for known EAPI, die otherwise
  2019-02-03  5:27 [gentoo-dev] [PATCH] opam.eclass: unbreak on EAPI=7 Georgy Yakovlev
@ 2019-02-03  5:35 ` Georgy Yakovlev
  2019-02-03  5:40 ` [gentoo-dev] [PATCH 1/2] opam.eclass: unbreak on EAPI=7 Georgy Yakovlev
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Georgy Yakovlev @ 2019-02-03  5:35 UTC (permalink / raw
  To: gentoo-dev; +Cc: Georgy Yakovlev

Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
---
 eclass/opam.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eclass/opam.eclass b/eclass/opam.eclass
index ba4f515f0ec..0342d46553d 100644
--- a/eclass/opam.eclass
+++ b/eclass/opam.eclass
@@ -13,8 +13,8 @@
 # src_install for opam-based packages.
 
 case ${EAPI:-0} in
-    0|1|2|3|4) die "You need at least EAPI-5 to use opam.eclass";;
-    *) ;;
+	5|6|7) ;;
+    *) die "${ECLASS}: EAPI ${EAPI} not supported" ;;
 esac
 
 RDEPEND=">=dev-lang/ocaml-4:="
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-dev] [PATCH 1/2] opam.eclass: unbreak on EAPI=7
  2019-02-03  5:27 [gentoo-dev] [PATCH] opam.eclass: unbreak on EAPI=7 Georgy Yakovlev
  2019-02-03  5:35 ` [gentoo-dev] [PATCH] opam.eclass: check only for known EAPI, die otherwise Georgy Yakovlev
@ 2019-02-03  5:40 ` Georgy Yakovlev
  2019-02-03  5:40 ` [gentoo-dev] [PATCH 2/2] opam.eclass: check only for known EAPI, die otherwise Georgy Yakovlev
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Georgy Yakovlev @ 2019-02-03  5:40 UTC (permalink / raw
  To: gentoo-dev; +Cc: Georgy Yakovlev

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@gentoo.org>
---
 eclass/opam.eclass | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

Sorry, forgot slashes in first version

diff --git a/eclass/opam.eclass b/eclass/opam.eclass
index 5c9c4950dd2..03ffc027641 100644
--- a/eclass/opam.eclass
+++ b/eclass/opam.eclass
@@ -1,51 +1,51 @@
 # Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: opam.eclass
 # @MAINTAINER:
 # Gentoo ML Project <ml@gentoo.org>
 # @AUTHOR:
 # Alexis Ballier <aballier@gentoo.org>
 # @SUPPORTED_EAPIS: 5 6 7
 # @BLURB: Provides functions for installing opam packages.
 # @DESCRIPTION:
 # Provides dependencies on opam and ocaml, opam-install and a default
 # src_install for opam-based packages.
 
 case ${EAPI:-0} in
     0|1|2|3|4) die "You need at least EAPI-5 to use opam.eclass";;
     *) ;;
 esac
 
 RDEPEND=">=dev-lang/ocaml-4:="
 DEPEND="${RDEPEND}
 	dev-ml/opam"
 
 # @FUNCTION: opam-install
 # @USAGE: <list of packages>
 # @DESCRIPTION:
 # Installs the opam packages given as arguments. For each "${pkg}" element in
 # that list, "${pkg}.install" must be readable from current working directory.
 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
 }
 
 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
 }
 
 EXPORT_FUNCTIONS src_install
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-dev] [PATCH 2/2] opam.eclass: check only for known EAPI, die otherwise
  2019-02-03  5:27 [gentoo-dev] [PATCH] opam.eclass: unbreak on EAPI=7 Georgy Yakovlev
  2019-02-03  5:35 ` [gentoo-dev] [PATCH] opam.eclass: check only for known EAPI, die otherwise Georgy Yakovlev
  2019-02-03  5:40 ` [gentoo-dev] [PATCH 1/2] opam.eclass: unbreak on EAPI=7 Georgy Yakovlev
@ 2019-02-03  5:40 ` Georgy Yakovlev
  2019-02-03  9:01 ` [gentoo-dev] [PATCH] opam.eclass: unbreak on EAPI=7 Sergei Trofimovich
  2019-02-04 10:52 ` Alexis Ballier
  4 siblings, 0 replies; 9+ messages in thread
From: Georgy Yakovlev @ 2019-02-03  5:40 UTC (permalink / raw
  To: gentoo-dev; +Cc: Georgy Yakovlev

Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
---
 eclass/opam.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eclass/opam.eclass b/eclass/opam.eclass
index 03ffc027641..c742ff7e936 100644
--- a/eclass/opam.eclass
+++ b/eclass/opam.eclass
@@ -1,51 +1,51 @@
 # Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: opam.eclass
 # @MAINTAINER:
 # Gentoo ML Project <ml@gentoo.org>
 # @AUTHOR:
 # Alexis Ballier <aballier@gentoo.org>
 # @SUPPORTED_EAPIS: 5 6 7
 # @BLURB: Provides functions for installing opam packages.
 # @DESCRIPTION:
 # Provides dependencies on opam and ocaml, opam-install and a default
 # src_install for opam-based packages.
 
 case ${EAPI:-0} in
-    0|1|2|3|4) die "You need at least EAPI-5 to use opam.eclass";;
-    *) ;;
+	5|6|7) ;;
+    *) die "${ECLASS}: EAPI ${EAPI} not supported" ;;
 esac
 
 RDEPEND=">=dev-lang/ocaml-4:="
 DEPEND="${RDEPEND}
 	dev-ml/opam"
 
 # @FUNCTION: opam-install
 # @USAGE: <list of packages>
 # @DESCRIPTION:
 # Installs the opam packages given as arguments. For each "${pkg}" element in
 # that list, "${pkg}.install" must be readable from current working directory.
 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" \
 			"${pkg}.install" || die
 	done
 }
 
 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
 	fi
 }
 
 EXPORT_FUNCTIONS src_install
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [gentoo-dev] [PATCH] opam.eclass: unbreak on EAPI=7
  2019-02-03  5:27 [gentoo-dev] [PATCH] opam.eclass: unbreak on EAPI=7 Georgy Yakovlev
                   ` (2 preceding siblings ...)
  2019-02-03  5:40 ` [gentoo-dev] [PATCH 2/2] opam.eclass: check only for known EAPI, die otherwise Georgy Yakovlev
@ 2019-02-03  9:01 ` Sergei Trofimovich
  2019-02-03  9:19   ` Georgy Yakovlev
  2019-02-04 10:52 ` Alexis Ballier
  4 siblings, 1 reply; 9+ messages in thread
From: Sergei Trofimovich @ 2019-02-03  9:01 UTC (permalink / raw
  To: Georgy Yakovlev, gentoo-dev

On Sat,  2 Feb 2019 21:27:29 -0800
Georgy Yakovlev <gyakovlev@gentoo.org> wrote:

> Since D, ED, ROOT, EROOT no longer have a trailing slash in EAPI=7
> This eclass is terribly broken, installing things into
> imageusr/...
...
>  		opam-installer -i \
> -			--prefix="${ED}usr" \
> +			--prefix="${ED%/}usr" \

Now this change strips '/' on older EAPIs as well. I guess you meant:
    --prefix="${ED%/}/usr" \

-- 

  Sergei


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-dev] [PATCH] opam.eclass: unbreak on EAPI=7
  2019-02-03  9:01 ` [gentoo-dev] [PATCH] opam.eclass: unbreak on EAPI=7 Sergei Trofimovich
@ 2019-02-03  9:19   ` Georgy Yakovlev
  0 siblings, 0 replies; 9+ messages in thread
From: Georgy Yakovlev @ 2019-02-03  9:19 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 688 bytes --]

On Sunday, February 3, 2019 1:01:17 AM PST Sergei Trofimovich wrote:
> On Sat,  2 Feb 2019 21:27:29 -0800
> 
> Georgy Yakovlev <gyakovlev@gentoo.org> wrote:
> > Since D, ED, ROOT, EROOT no longer have a trailing slash in EAPI=7
> > This eclass is terribly broken, installing things into
> > imageusr/...
> 
> ...
> 
> >  		opam-installer -i \
> > 
> > -			--prefix="${ED}usr" \
> > +			--prefix="${ED%/}usr" \
> 
> Now this change strips '/' on older EAPIs as well. I guess you meant:
>     --prefix="${ED%/}/usr" \
yeah, I missed that in the first version of the patch. second one is ok, 
probably should have posted separately as a non-reply.

-- 
Georgy Yakovlev
Gentoo Linux Developer

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-dev] [PATCH] opam.eclass: unbreak on EAPI=7
  2019-02-03  5:27 [gentoo-dev] [PATCH] opam.eclass: unbreak on EAPI=7 Georgy Yakovlev
                   ` (3 preceding siblings ...)
  2019-02-03  9:01 ` [gentoo-dev] [PATCH] opam.eclass: unbreak on EAPI=7 Sergei Trofimovich
@ 2019-02-04 10:52 ` Alexis Ballier
  2019-02-04 21:42   ` Georgy Yakovlev
  4 siblings, 1 reply; 9+ messages in thread
From: Alexis Ballier @ 2019-02-04 10:52 UTC (permalink / raw
  To: gentoo-dev

On Sat,  2 Feb 2019 21:27:29 -0800
Georgy Yakovlev <gyakovlev@gentoo.org> wrote:

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


You might want to check https://github.com/aballier/ml-overlay



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-dev] [PATCH] opam.eclass: unbreak on EAPI=7
  2019-02-04 10:52 ` Alexis Ballier
@ 2019-02-04 21:42   ` Georgy Yakovlev
  2019-02-05 10:21     ` Alexis Ballier
  0 siblings, 1 reply; 9+ messages in thread
From: Georgy Yakovlev @ 2019-02-04 21:42 UTC (permalink / raw
  To: Alexis Ballier; +Cc: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 967 bytes --]

On Monday, February 4, 2019 2:52:37 AM PST Alexis Ballier wrote:
> On Sat,  2 Feb 2019 21:27:29 -0800
> 
> Georgy Yakovlev <gyakovlev@gentoo.org> wrote:
> > Since D, ED, ROOT, EROOT no longer have a trailing slash in EAPI=7
> > This eclass is terribly broken, installing things into
> > imageusr/...
> 
> You might want to check https://github.com/aballier/ml-overlay
Hi!

I don't really use this eclass in any way.
A user reported breakage, I wrote a patch and submitted here for review.

there is a commit in overlay that adds slashes, but paths will end up having 

// two slashes on EAPI6 and single on EAPI7 

https://github.com/aballier/ml-overlay/commit/
98c0f16bc490349f17afdd7a7675b9b5264d267e

also probably the docdir subdir part of opam_src_install() will  also fail, as 
there are no slashes.


::gentoo version needs some kind of fix as any EAPI7 ebuild that uses 
opam.eclass is broken.

If you are ok with my patches I can commit, just let me know.



[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-dev] [PATCH] opam.eclass: unbreak on EAPI=7
  2019-02-04 21:42   ` Georgy Yakovlev
@ 2019-02-05 10:21     ` Alexis Ballier
  0 siblings, 0 replies; 9+ messages in thread
From: Alexis Ballier @ 2019-02-05 10:21 UTC (permalink / raw
  To: gentoo-dev

On Mon, 04 Feb 2019 13:42:21 -0800
Georgy Yakovlev <gyakovlev@gentoo.org> wrote:

> On Monday, February 4, 2019 2:52:37 AM PST Alexis Ballier wrote:
> > On Sat,  2 Feb 2019 21:27:29 -0800
> > 
> > Georgy Yakovlev <gyakovlev@gentoo.org> wrote:
> > > Since D, ED, ROOT, EROOT no longer have a trailing slash in EAPI=7
> > > This eclass is terribly broken, installing things into
> > > imageusr/...
> > 
> > You might want to check https://github.com/aballier/ml-overlay
> Hi!
> 
> I don't really use this eclass in any way.
> A user reported breakage, I wrote a patch and submitted here for
> review.
> 
> there is a commit in overlay that adds slashes, but paths will end up
> having 
> 
> // two slashes on EAPI6 and single on EAPI7 
> 
> https://github.com/aballier/ml-overlay/commit/
> 98c0f16bc490349f17afdd7a7675b9b5264d267e
> 
> also probably the docdir subdir part of opam_src_install() will  also
> fail, as there are no slashes.
> 
> 
> ::gentoo version needs some kind of fix as any EAPI7 ebuild that uses 
> opam.eclass is broken.
> 
> If you are ok with my patches I can commit, just let me know.


yes go ahead (modulo list comments ofc =)


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-02-05 10:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-03  5:27 [gentoo-dev] [PATCH] opam.eclass: unbreak on EAPI=7 Georgy Yakovlev
2019-02-03  5:35 ` [gentoo-dev] [PATCH] opam.eclass: check only for known EAPI, die otherwise Georgy Yakovlev
2019-02-03  5:40 ` [gentoo-dev] [PATCH 1/2] opam.eclass: unbreak on EAPI=7 Georgy Yakovlev
2019-02-03  5:40 ` [gentoo-dev] [PATCH 2/2] opam.eclass: check only for known EAPI, die otherwise Georgy Yakovlev
2019-02-03  9:01 ` [gentoo-dev] [PATCH] opam.eclass: unbreak on EAPI=7 Sergei Trofimovich
2019-02-03  9:19   ` Georgy Yakovlev
2019-02-04 10:52 ` Alexis Ballier
2019-02-04 21:42   ` Georgy Yakovlev
2019-02-05 10:21     ` Alexis Ballier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox