Rewrite logic to resemble _systemd_get_dir from systemd.eclass. Remove incorrect command substitution: pkg-config --exists does not write to stdout.
Die when pkg-config --variable fails. Signed-off-by: Mike Gilbert <flop...@gentoo.org> --- eclass/udev.eclass | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/eclass/udev.eclass b/eclass/udev.eclass index 2873ae9a92c3..9a65b080f171 100644 --- a/eclass/udev.eclass +++ b/eclass/udev.eclass @@ -50,12 +50,12 @@ fi # @DESCRIPTION: # Get unprefixed udevdir. _udev_get_udevdir() { - if $($(tc-getPKG_CONFIG) --exists udev); then - local udevdir="$($(tc-getPKG_CONFIG) --variable=udevdir udev)" - echo "${udevdir#${EPREFIX%/}}" - else - echo /lib/udev + local udevdir="/lib/udev" + if $(tc-getPKG_CONFIG) --exists udev; then + udevdir="$($(tc-getPKG_CONFIG) --variable=udevdir udev)" || die + udevdir="${udevdir#${EPREFIX}}" fi + echo "${udevdir}" } # @FUNCTION: udev_get_udevdir -- 2.30.0