From: sof Date: Thu, 11 Jun 1998 10:09:02 +0000 (+0000) Subject: [project @ 1998-06-11 10:09:02 by sof] X-Git-Tag: Approx_2487_patches~583 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=ee9ef43a08a6c89168c7eca0983fc58a87fb4481 [project @ 1998-06-11 10:09:02 by sof] install-bin: * if any of $(VERSION_SYMLINKS_FOR) already exists as a symlink, replace it with a new one. --- diff --git a/distrib/Makefile-bin.in b/distrib/Makefile-bin.in index 2c55f6d..fdfdb6a 100644 --- a/distrib/Makefile-bin.in +++ b/distrib/Makefile-bin.in @@ -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