From a0535aab53f9c6b020a0691b7be5efdfb1b96147 Mon Sep 17 00:00:00 2001 From: Demi Marie Obenour Date: Wed, 5 Apr 2023 16:47:10 -0400 Subject: [PATCH] Fix make install when already installed Previously the ln commands would fail because the symlinks already existed. (cherry picked from commit c97ad3ac5e92dd9ce73ddf5199b02ac9f5f39039) --- Makefile | 8 ++++---- agent/Makefile | 4 ++-- daemon/Makefile | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index eb0ff9a2..88c5b8b8 100644 --- a/Makefile +++ b/Makefile @@ -27,12 +27,12 @@ all-base: install-base: all-base +$(MAKE) install -C libqrexec $(PYTHON) setup.py install -O1 $(PYTHON_PREFIX_ARG) --skip-build --root $(DESTDIR) - ln -s qrexec-policy-exec $(DESTDIR)/usr/bin/qrexec-policy + ln -sf qrexec-policy-exec $(DESTDIR)/usr/bin/qrexec-policy install -d $(DESTDIR)/usr/lib/qubes -m 755 install -t $(DESTDIR)/usr/lib/qubes -m 755 lib/* install -d $(DESTDIR)/etc/qubes-rpc -m 755 - ln -s /var/run/qubes/policy-agent.sock $(DESTDIR)/etc/qubes-rpc/policy.Ask - ln -s /var/run/qubes/policy-agent.sock $(DESTDIR)/etc/qubes-rpc/policy.Notify + ln -sf /var/run/qubes/policy-agent.sock $(DESTDIR)/etc/qubes-rpc/policy.Ask + ln -sf /var/run/qubes/policy-agent.sock $(DESTDIR)/etc/qubes-rpc/policy.Notify install -d $(DESTDIR)/etc/xdg/autostart -m 755 install -m 644 policy-agent-extra/qrexec-policy-agent.desktop \ $(DESTDIR)/etc/xdg/autostart/qrexec-policy-agent.desktop @@ -51,7 +51,7 @@ install-dom0: all-dom0 for RPCNAME in \ policy.List policy.Get policy.Replace policy.Remove \ policy.include.List policy.include.Get policy.include.Replace policy.include.Remove; \ - do ln -s /usr/bin/qubes-policy-admin $(DESTDIR)/etc/qubes-rpc/$$RPCNAME; \ + do ln -sf /usr/bin/qubes-policy-admin $(DESTDIR)/etc/qubes-rpc/$$RPCNAME; \ done install -d $(DESTDIR)/etc/qubes-rpc/policy -m 775 diff --git a/agent/Makefile b/agent/Makefile index de703355..2218335c 100644 --- a/agent/Makefile +++ b/agent/Makefile @@ -38,8 +38,8 @@ install: all install qrexec-client-vm $(DESTDIR)/usr/bin install -d $(DESTDIR)/usr/share/man/man1 install qrexec-client-vm.1.gz $(DESTDIR)/usr/share/man/man1 - ln -s ../../bin/qrexec-client-vm $(DESTDIR)/usr/lib/qubes/qrexec-client-vm - ln -s ../../bin/qrexec-client-vm $(DESTDIR)/usr/lib/qubes/qrexec_client_vm + ln -sf ../../bin/qrexec-client-vm $(DESTDIR)/usr/lib/qubes/qrexec-client-vm + ln -sf ../../bin/qrexec-client-vm $(DESTDIR)/usr/lib/qubes/qrexec_client_vm install qrexec-fork-server $(DESTDIR)/usr/bin ifeq ($(os), Debian) install -D -m 0644 qrexec.pam.debian $(DESTDIR)/etc/pam.d/qrexec diff --git a/daemon/Makefile b/daemon/Makefile index 6d41925f..c787d32c 100644 --- a/daemon/Makefile +++ b/daemon/Makefile @@ -18,7 +18,7 @@ install: all install -t $(DESTDIR)/usr/sbin -m 755 qrexec-daemon install -t $(DESTDIR)/usr/bin -m 755 qrexec-client install -d $(DESTDIR)/usr/lib/qubes - ln -s ../../bin/qrexec-client $(DESTDIR)/usr/lib/qubes/qrexec-client + ln -sf ../../bin/qrexec-client $(DESTDIR)/usr/lib/qubes/qrexec-client .PHONY: all clean install qrexec-daemon qrexec-client: %: %.o