only generate the symlink to host sed once as reported by petev in bug 628
authorMike Frysinger <vapier@gentoo.org>
Sun, 8 Jan 2006 09:59:23 +0000 (09:59 -0000)
committerMike Frysinger <vapier@gentoo.org>
Sun, 8 Jan 2006 09:59:23 +0000 (09:59 -0000)
package/sed/sed.mk

index de15e97dd003ff4713e6991d3359dcc7ca440694..0dee41798c01f78c8d75af315ac4b6a57151f3da 100644 (file)
@@ -62,11 +62,18 @@ build-sed-host-binary: $(SED_DIR1)/$(SED_BINARY)
                    $(HOST_SED_DIR)/usr/man $(HOST_SED_DIR)/usr/share/doc; fi
 
 use-sed-host-binary:
-       @if [ -x /usr/bin/sed ]; then SED="/usr/bin/sed"; else \
-           if [ -x /bin/sed ]; then SED="/bin/sed"; fi; fi; \
-           mkdir -p $(HOST_SED_DIR)/bin; \
-           rm -f $(HOST_SED_DIR)/$(SED_TARGET_BINARY); \
-           ln -s $$SED $(HOST_SED_DIR)/$(SED_TARGET_BINARY)
+       @if [ -x /usr/bin/sed ] ; then \
+               SED="/usr/bin/sed" ; \
+       else \
+               if [ -x /bin/sed ] ; then \
+                       SED="/bin/sed" ; \
+               fi \
+       fi ; \
+       if [ ! -e "$(HOST_SED_DIR)/$(SED_TARGET_BINARY)" ] ; then \
+               mkdir -p "$(HOST_SED_DIR)/bin"; \
+               rm -f "$(HOST_SED_DIR)/$(SED_TARGET_BINARY)"; \
+               ln -s "$$SED" "$(HOST_SED_DIR)/$(SED_TARGET_BINARY)"; \
+       fi
 
 host-sed: $(HOST_SED_TARGET)