From cce4d1bb7cd1c52f603525e4f0bf9fb0810364ea Mon Sep 17 00:00:00 2001 From: Tom Levy Date: Sat, 20 Jul 2024 12:42:07 +0000 Subject: [PATCH] Simplify relative symlink conversion The string manipulation can be done in pure sh, there is no need for grep and sed. --- webapp/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webapp/Makefile b/webapp/Makefile index 48d66f0e7f8..008150dbff7 100644 --- a/webapp/Makefile +++ b/webapp/Makefile @@ -44,11 +44,11 @@ install-domserver: # Now change all relative symlinks in webapp/public to their correct paths for link in $$(find $(DESTDIR)$(domserver_webappdir)/public/$$dir -maxdepth 2 -type l); do \ target=$$(readlink $$link) ; \ - if echo $${target} | grep -q '\.\./vendor' ; then \ + case $${target} in *../vendor*) \ rm $$link ; \ - realtarget=$(domserver_webappdir)/vendor$$(echo $${target} | sed 's!^.*\.\./vendor!!') ; \ + realtarget=$(domserver_webappdir)/vendor$${target#*../vendor} ; \ ln -s $$realtarget $$link ; \ - fi \ + esac \ done $(INSTALL_DATA) -t $(DESTDIR)$(domserver_webappdir) phpunit.xml.dist .env