about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2014-03-28 14:57:08 -0700
committerBrian Anderson <banderson@mozilla.com>2014-03-28 15:50:34 -0700
commit2205c48ee4949521d1a1a416afdb7ad7777b4a65 (patch)
tree44d5b46c5c308805ef168e20d6877cc9510a894f
parent01d823b4de9ecf7bf37e0e6433615592ac9b5565 (diff)
downloadrust-2205c48ee4949521d1a1a416afdb7ad7777b4a65.tar.gz
rust-2205c48ee4949521d1a1a416afdb7ad7777b4a65.zip
install: Explicitly delete the manifest during uninstall. Misc cleanup
-rw-r--r--src/etc/install.sh36
1 files changed, 20 insertions, 16 deletions
diff --git a/src/etc/install.sh b/src/etc/install.sh
index 12a70d5d306..852347d3d18 100644
--- a/src/etc/install.sh
+++ b/src/etc/install.sh
@@ -234,16 +234,16 @@ validate_opt
 # Sanity check: can we run the binaries?
 if [ -z "${CFG_DISABLE_VERIFY}" ]
 then
-	# Don't do this if uninstalling. Failure here won't help in any way.
-	if [ -z "${CFG_UNINSTALL}" ]
-	then
-		msg "verifying platform can run binaries"
-		"${CFG_SRC_DIR}/bin/rustc" --version > /dev/null
-		if [ $? -ne 0 ]
-		then
-			err "can't execute rustc binary on this platform"
-		fi
-	fi
+    # Don't do this if uninstalling. Failure here won't help in any way.
+    if [ -z "${CFG_UNINSTALL}" ]
+    then
+        msg "verifying platform can run binaries"
+        "${CFG_SRC_DIR}/bin/rustc" --version > /dev/null
+        if [ $? -ne 0 ]
+        then
+            err "can't execute rustc binary on this platform"
+        fi
+    fi
 fi
 
 # Sanity check: can we can write to the destination?
@@ -255,7 +255,7 @@ if [ $? -ne 0 ]
 then
     err "can't write to destination. consider \`sudo\`."
 fi
-rm "${CFG_LIBDIR}/rust-install-probe"
+rm -f "${CFG_LIBDIR}/rust-install-probe"
 need_ok "failed to remove install probe"
 
 # Sanity check: don't install to the directory containing the installer.
@@ -281,7 +281,7 @@ then
         msg "removing $p"
         if [ -f "$p" ]
         then
-            rm "$p"
+            rm -f "$p"
             if [ $? -ne 0 ]
             then
                 warn "failed to remove $p"
@@ -291,12 +291,16 @@ then
         fi
     done < "${INSTALLED_MANIFEST}"
 
-	# TODO: Remove the manifest.
-	# If we fail to remove rustlib below, then the installed manifest will
-	# still be full; the installed manifest needs to be empty before install.
+    # If we fail to remove rustlib below, then the installed manifest will
+    # still be full; the installed manifest needs to be empty before install.
+    msg "removing ${CFG_LIBDIR}/rustlib/manifest"
+    rm -f "${CFG_LIBDIR}/rustlib/manifest"
+    # For the above reason, this is a hard error
+    need_ok "failed to remove installed manifest"
 
     # Remove 'rustlib' directory
-    rm -r "${CFG_LIBDIR}/rustlib"
+    msg "removing ${CFG_LIBDIR}/rustlib"
+    rm -Rf "${CFG_LIBDIR}/rustlib"
     if [ $? -ne 0 ]
     then
         warn "failed to remove rustlib"