about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2004-10-31T12·01+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2004-10-31T12·01+0000
commit2aa1f4717bdf9432a75f13088ec79644be9a7d88 (patch)
treec46e3f88b54366218faaac212a7153db55d343d6
parentf8ac8d1ec835cf070afd62c0cef14a81e9a49302 (diff)
* Fix `File exists' errors if the `result' symlink exists but is
  dangling.

-rwxr-xr-xscripts/nix-build.in9
1 files changed, 4 insertions, 5 deletions
diff --git a/scripts/nix-build.in b/scripts/nix-build.in
index 9ae5a0edebfe..43d818274b33 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