From: Patrick Deubel <33164686+pdeubel@users.noreply.github.com> Date: Tue, 25 Apr 2023 15:31:21 +0000 (+0200) Subject: Replaced MAKECMDGOALS with DEFAULT_TARGETS to check for systemd X-Git-Tag: 1.14~7 X-Git-Url: https://git.donarmstrong.com/?p=deb_pkgs%2Fautorandr.git;a=commitdiff_plain;h=ac8fb582ced313a8a86c335ccac419581a8e7b74 Replaced MAKECMDGOALS with DEFAULT_TARGETS to check for systemd 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). --- diff --git a/Makefile b/Makefile index e184faa..36d30ce 100644 --- 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"