[project @ 1998-06-11 10:09:02 by sof]
authorsof <unknown>
Thu, 11 Jun 1998 10:09:02 +0000 (10:09 +0000)
committersof <unknown>
Thu, 11 Jun 1998 10:09:02 +0000 (10:09 +0000)
install-bin:
   * if any of $(VERSION_SYMLINKS_FOR) already exists as a symlink,
     replace it with a new one.

distrib/Makefile-bin.in

index 2c55f6d..fdfdb6a 100644 (file)
@@ -205,8 +205,15 @@ install-bin:
        for i in $(VERSION_SYMLINKS_FOR) ""; do \
           if [ "x$$i" != "x" ]; then           \
                ( cd $(bindir);                 \
-                 $(RM) $$i;                    \
-                 $(LN_S) $$i-$(version) $$i    \
+                 if ( $(PERL) -e '$$fn="'$$i'"; exit ((! -f $$fn || -l $$fn) ? 0 : 1);' ); then \
+                    echo "Creating a symbol link from $$i-$(version) to $$i"; \
+                    $(RM) $$i; \
+                    $(LN_S) $$i-$(version) $$i; \
+                 else \
+                    echo "Creating a symbol link from $$i-$(version) to $$i failed: \`$$i' already exists"; \
+                    echo "Perhaps remove \`$$i' manually?"; \
+                    exit 1; \
+                 fi;\
                );                              \
           fi;                                  \
        done