mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-17 01:13:11 +00:00
install: Explicitly delete the manifest during uninstall. Misc cleanup
This commit is contained in:
parent
01d823b4de
commit
2205c48ee4
@ -234,16 +234,16 @@ validate_opt
|
|||||||
# Sanity check: can we run the binaries?
|
# Sanity check: can we run the binaries?
|
||||||
if [ -z "${CFG_DISABLE_VERIFY}" ]
|
if [ -z "${CFG_DISABLE_VERIFY}" ]
|
||||||
then
|
then
|
||||||
# Don't do this if uninstalling. Failure here won't help in any way.
|
# Don't do this if uninstalling. Failure here won't help in any way.
|
||||||
if [ -z "${CFG_UNINSTALL}" ]
|
if [ -z "${CFG_UNINSTALL}" ]
|
||||||
then
|
then
|
||||||
msg "verifying platform can run binaries"
|
msg "verifying platform can run binaries"
|
||||||
"${CFG_SRC_DIR}/bin/rustc" --version > /dev/null
|
"${CFG_SRC_DIR}/bin/rustc" --version > /dev/null
|
||||||
if [ $? -ne 0 ]
|
if [ $? -ne 0 ]
|
||||||
then
|
then
|
||||||
err "can't execute rustc binary on this platform"
|
err "can't execute rustc binary on this platform"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Sanity check: can we can write to the destination?
|
# Sanity check: can we can write to the destination?
|
||||||
@ -255,7 +255,7 @@ if [ $? -ne 0 ]
|
|||||||
then
|
then
|
||||||
err "can't write to destination. consider \`sudo\`."
|
err "can't write to destination. consider \`sudo\`."
|
||||||
fi
|
fi
|
||||||
rm "${CFG_LIBDIR}/rust-install-probe"
|
rm -f "${CFG_LIBDIR}/rust-install-probe"
|
||||||
need_ok "failed to remove install probe"
|
need_ok "failed to remove install probe"
|
||||||
|
|
||||||
# Sanity check: don't install to the directory containing the installer.
|
# Sanity check: don't install to the directory containing the installer.
|
||||||
@ -281,7 +281,7 @@ then
|
|||||||
msg "removing $p"
|
msg "removing $p"
|
||||||
if [ -f "$p" ]
|
if [ -f "$p" ]
|
||||||
then
|
then
|
||||||
rm "$p"
|
rm -f "$p"
|
||||||
if [ $? -ne 0 ]
|
if [ $? -ne 0 ]
|
||||||
then
|
then
|
||||||
warn "failed to remove $p"
|
warn "failed to remove $p"
|
||||||
@ -291,12 +291,16 @@ then
|
|||||||
fi
|
fi
|
||||||
done < "${INSTALLED_MANIFEST}"
|
done < "${INSTALLED_MANIFEST}"
|
||||||
|
|
||||||
# TODO: Remove the manifest.
|
# If we fail to remove rustlib below, then the installed manifest will
|
||||||
# If we fail to remove rustlib below, then the installed manifest will
|
# still be full; the installed manifest needs to be empty before install.
|
||||||
# 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
|
# Remove 'rustlib' directory
|
||||||
rm -r "${CFG_LIBDIR}/rustlib"
|
msg "removing ${CFG_LIBDIR}/rustlib"
|
||||||
|
rm -Rf "${CFG_LIBDIR}/rustlib"
|
||||||
if [ $? -ne 0 ]
|
if [ $? -ne 0 ]
|
||||||
then
|
then
|
||||||
warn "failed to remove rustlib"
|
warn "failed to remove rustlib"
|
||||||
|
Loading…
Reference in New Issue
Block a user