From 2aa1f4717bdf9432a75f13088ec79644be9a7d88 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sun, 31 Oct 2004 12:01:16 +0000 Subject: * Fix `File exists' errors if the `result' symlink exists but is dangling. --- scripts/nix-build.in | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/nix-build.in b/scripts/nix-build.in index 9ae5a0ede..43d818274 100755 --- a/scripts/nix-build.in +++ b/scripts/nix-build.in @@ -27,12 +27,11 @@ for i in "$@"; do for j in $outPaths; do echo "$j" if test -z "$noLink"; then - if test -e result; then - if ! test -L result; then - echo "cannot remove \`result\' (not a symlink)" - exit 1 - fi + if test -L result; then rm result + elif test -e result; then + echo "cannot remove \`result' (not a symlink)" + exit 1 fi ln -s "$j" result fi -- cgit v1.2.3