]> git.donarmstrong.com Git - deb_pkgs/autorandr.git/commitdiff
Replaced MAKECMDGOALS with DEFAULT_TARGETS to check for systemd
authorPatrick Deubel <33164686+pdeubel@users.noreply.github.com>
Tue, 25 Apr 2023 15:31:21 +0000 (17:31 +0200)
committerPhillip Berndt <phillip.berndt@googlemail.com>
Tue, 25 Apr 2023 16:21:44 +0000 (18:21 +0200)
when installing udev rules

MAKECMDGOALS does not containg "systemd" although systemd is used
on the system. Thus, an incorrect udev rule is created. DEFAULT_TARGETS
however does contain "systemd", because of a check earlier in the
Makefile (lines 83-85).

Makefile

index e184faaf8ffa288ffe1726b3a2f65a0cb9735cad..36d30ce6a6dc29ac1a7d1e098042eac4dcf2eb1f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -134,7 +134,7 @@ endif
 install_udev:
        $(if $(UDEV_RULES_DIR),,$(error UDEV_RULES_DIR is not defined))
        mkdir -p ${DESTDIR}/${UDEV_RULES_DIR}/
-       echo 'ACTION=="change", SUBSYSTEM=="drm", RUN+="$(if $(findstring systemd, $(MAKECMDGOALS)),/bin/systemctl start --no-block autorandr.service,${PREFIX}/bin/autorandr --batch --change --default default)"' > ${DESTDIR}/${UDEV_RULES_DIR}/40-monitor-hotplug.rules
+       echo 'ACTION=="change", SUBSYSTEM=="drm", RUN+="$(if $(findstring systemd, $(DEFAULT_TARGETS)),/bin/systemctl start --no-block autorandr.service,${PREFIX}/bin/autorandr --batch --change --default default)"' > ${DESTDIR}/${UDEV_RULES_DIR}/40-monitor-hotplug.rules
        @echo
        @echo "To activate the udev rules, run this command as root:"
        @echo "    udevadm control --reload-rules"