eclass/udev: Sync with Gentoo

It's from Gentoo commit c8af7eb1285a2683460618b71e2e9a14ca6badcd.
This commit is contained in:
Flatcar Buildbot 2024-10-21 07:07:28 +00:00
parent 34d86c70b2
commit d7e18ba370

View File

@ -4,7 +4,7 @@
# @ECLASS: udev.eclass
# @MAINTAINER:
# systemd@gentoo.org
# @SUPPORTED_EAPIS: 5 6 7 8
# @SUPPORTED_EAPIS: 7 8
# @BLURB: Default eclass for determining udev directories.
# @DESCRIPTION:
# Default eclass for determining udev directories.
@ -40,21 +40,13 @@ if [[ -z ${_UDEV_ECLASS} ]]; then
_UDEV_ECLASS=1
case ${EAPI} in
6)
ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated EAPI ${EAPI}!"
ewarn "${CATEGORY}/${PF}: Support will be removed on 2024-10-08. Please port to newer EAPI."
;;
7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
inherit toolchain-funcs
if [[ ${EAPI} == [56] ]]; then
DEPEND="virtual/pkgconfig"
else
BDEPEND="virtual/pkgconfig"
fi
BDEPEND="virtual/pkgconfig"
# @FUNCTION: _udev_get_udevdir
# @INTERNAL
@ -75,7 +67,7 @@ _udev_get_udevdir() {
# @DESCRIPTION:
# Use the short version $(get_udevdir) instead!
udev_get_udevdir() {
debug-print-function ${FUNCNAME} "${@}"
debug-print-function ${FUNCNAME} "$@"
eerror "This ebuild should be using the get_udevdir() function instead of the deprecated udev_get_udevdir()"
die "Deprecated function call: udev_get_udevdir(), please report to (overlay) maintainers."
@ -87,7 +79,7 @@ udev_get_udevdir() {
# This function always succeeds, even if udev is not installed.
# The fallback value is set to /lib/udev
get_udevdir() {
debug-print-function ${FUNCNAME} "${@}"
debug-print-function ${FUNCNAME} "$@"
echo "$(_udev_get_udevdir)"
}
@ -97,7 +89,7 @@ get_udevdir() {
# @DESCRIPTION:
# Install udev rule(s). Uses doins, thus it is fatal.
udev_dorules() {
debug-print-function ${FUNCNAME} "${@}"
debug-print-function ${FUNCNAME} "$@"
(
insopts -m 0644
@ -111,7 +103,7 @@ udev_dorules() {
# @DESCRIPTION:
# Install udev rule with a new name. Uses newins, thus it is fatal.
udev_newrules() {
debug-print-function ${FUNCNAME} "${@}"
debug-print-function ${FUNCNAME} "$@"
(
insopts -m 0644
@ -126,7 +118,7 @@ udev_newrules() {
# Should be called from pkg_postinst and pkg_postrm in packages which install
# udev rules or hwdb data.
udev_reload() {
if [[ -n ${ROOT%/} ]]; then
if [[ -n ${ROOT} ]]; then
return 0
fi