Skip to content

Commit cc5fae7

Browse files
committed
install: Error on uninstall if manifest can't be found
1 parent 8694c28 commit cc5fae7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/etc/install.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ need_ok "failed to remove install probe"
237237
"${CFG_SRC_DIR}/bin/rustc" --version > /dev/null
238238
need_ok "can't run these binaries on this platform"
239239

240+
240241
# First, uninstall from the installation prefix
241242
# FIXME: Hardcoded 'rustlib' ignores CFG_RUSTLIBDIR
242243
if [ -f "${CFG_PREFIX}/lib/rustlib/manifest" ]
@@ -251,6 +252,12 @@ then
251252
msg "uninstall ${CFG_PREFIX}/lib/rustlib"
252253
rm -r "${CFG_PREFIX}/lib/rustlib"
253254
need_ok "failed to remove rustlib"
255+
else
256+
if [ -n "${CFG_UNINSTALL}" ]
257+
then
258+
err "unable to find manifest at ${CFG_PREFIX}/lib/rustlib"
259+
exit 0
260+
fi
254261
fi
255262

256263
# If we're only uninstalling then exit

0 commit comments

Comments
 (0)