1 |
Rewrite logic to resemble _systemd_get_dir from systemd.eclass. |
2 |
|
3 |
Remove incorrect command substitution: pkg-config --exists does not |
4 |
write to stdout. |
5 |
|
6 |
Die when pkg-config --variable fails. |
7 |
|
8 |
Remove SYSROOT from pkg-config output in case the user is cross- |
9 |
compiling with a pkg-config wrapper that sets PKG_CONFIG_SYSROOT_DIR. |
10 |
|
11 |
Signed-off-by: Mike Gilbert <floppym@g.o> |
12 |
--- |
13 |
eclass/udev.eclass | 11 ++++++----- |
14 |
1 file changed, 6 insertions(+), 5 deletions(-) |
15 |
|
16 |
diff --git a/eclass/udev.eclass b/eclass/udev.eclass |
17 |
index 2873ae9a92c3..82af1ea7788b 100644 |
18 |
--- a/eclass/udev.eclass |
19 |
+++ b/eclass/udev.eclass |
20 |
@@ -50,12 +50,13 @@ fi |
21 |
# @DESCRIPTION: |
22 |
# Get unprefixed udevdir. |
23 |
_udev_get_udevdir() { |
24 |
- if $($(tc-getPKG_CONFIG) --exists udev); then |
25 |
- local udevdir="$($(tc-getPKG_CONFIG) --variable=udevdir udev)" |
26 |
- echo "${udevdir#${EPREFIX%/}}" |
27 |
- else |
28 |
- echo /lib/udev |
29 |
+ local udevdir="/lib/udev" |
30 |
+ if $(tc-getPKG_CONFIG) --exists udev; then |
31 |
+ udevdir="$($(tc-getPKG_CONFIG) --variable=udevdir udev)" || die |
32 |
+ udevdir="${udevdir#${SYSROOT}}" |
33 |
+ udevdir="${udevdir#${EPREFIX}}" |
34 |
fi |
35 |
+ echo "${udevdir}" |
36 |
} |
37 |
|
38 |
# @FUNCTION: udev_get_udevdir |
39 |
-- |
40 |
2.30.0 |