public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] udev.eclass: EAPI 8 support
@ 2021-06-26 19:24 David Michael
  2021-06-26 22:57 ` Ionen Wolkens
  0 siblings, 1 reply; 2+ messages in thread
From: David Michael @ 2021-06-26 19:24 UTC (permalink / raw
  To: gentoo-dev; +Cc: udev-bugs

This also drops EAPIs < 5 to match toolchain-funcs.eclass.

Signed-off-by: David Michael <fedora.dm0@gmail.com>
---

This probably could have been sent in a series with
https://archives.gentoo.org/gentoo-dev/message/22db5157cab5d6d173483fbc16377081

 eclass/udev.eclass | 25 +++++++++++--------------
 1 file changed, 11 insertions(+), 14 deletions(-)

diff --git a/eclass/udev.eclass b/eclass/udev.eclass
index 2873ae9a92c..7d5f59ab8d9 100644
--- a/eclass/udev.eclass
+++ b/eclass/udev.eclass
@@ -1,10 +1,10 @@
-# Copyright 1999-2018 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: udev.eclass
 # @MAINTAINER:
 # udev-bugs@gentoo.org
-# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7
+# @SUPPORTED_EAPIS: 5 6 7 8
 # @BLURB: Default eclass for determining udev directories.
 # @DESCRIPTION:
 # Default eclass for determining udev directories.
@@ -28,18 +28,17 @@
 # }
 # @CODE
 
+case ${EAPI} in
+	5|6|7|8) ;;
+	*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
+esac
+
 if [[ -z ${_UDEV_ECLASS} ]]; then
 _UDEV_ECLASS=1
 
 inherit toolchain-funcs
 
-case ${EAPI:-0} in
-	0|1|2|3|4|5|6|7) ;;
-	*) die "${ECLASS}.eclass API in EAPI ${EAPI} not yet established."
-esac
-
-if [[ ${EAPI:-0} == [0123456] ]]; then
-	RDEPEND=""
+if [[ ${EAPI} == [56] ]]; then
 	DEPEND="virtual/pkgconfig"
 else
 	BDEPEND="virtual/pkgconfig"
@@ -82,8 +81,7 @@ get_udevdir() {
 # @FUNCTION: udev_dorules
 # @USAGE: <rule> [...]
 # @DESCRIPTION:
-# Install udev rule(s). Uses doins, thus it is fatal in EAPI 4
-# and non-fatal in earlier EAPIs.
+# Install udev rule(s). Uses doins, thus it is fatal.
 udev_dorules() {
 	debug-print-function ${FUNCNAME} "${@}"
 
@@ -97,8 +95,7 @@ udev_dorules() {
 # @FUNCTION: udev_newrules
 # @USAGE: <oldname> <newname>
 # @DESCRIPTION:
-# Install udev rule with a new name. Uses newins, thus it is fatal
-# in EAPI 4 and non-fatal in earlier EAPIs.
+# Install udev rule with a new name. Uses newins, thus it is fatal.
 udev_newrules() {
 	debug-print-function ${FUNCNAME} "${@}"
 
@@ -113,7 +110,7 @@ udev_newrules() {
 # @DESCRIPTION:
 # Run udevadm control --reload to refresh rules and databases
 udev_reload() {
-	if [[ ${ROOT} != "" ]] && [[ ${ROOT} != "/" ]]; then
+	if [[ -n ${ROOT%/} ]]; then
 		return 0
 	fi
 
-- 
2.31.1


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

* Re: [gentoo-dev] [PATCH] udev.eclass: EAPI 8 support
  2021-06-26 19:24 [gentoo-dev] [PATCH] udev.eclass: EAPI 8 support David Michael
@ 2021-06-26 22:57 ` Ionen Wolkens
  0 siblings, 0 replies; 2+ messages in thread
From: Ionen Wolkens @ 2021-06-26 22:57 UTC (permalink / raw
  To: gentoo-dev

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

On Sat, Jun 26, 2021 at 03:24:58PM -0400, David Michael wrote:
>  # @ECLASS: udev.eclass
>  # @MAINTAINER:
>  # udev-bugs@gentoo.org
> -# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7
> +# @SUPPORTED_EAPIS: 5 6 7 8

Wouldn't EAPI-8 be a good occasion to refactor _udev_get_udevdir
into keeping EPREFIX?

While udev rules don't make much sense on prefix, ebuilds are currently
adding EPREFIX to it everywhere so it doesn't fail to install because
of rules.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2021-06-26 22:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-26 19:24 [gentoo-dev] [PATCH] udev.eclass: EAPI 8 support David Michael
2021-06-26 22:57 ` Ionen Wolkens

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