Skip to content

Commit 4c547f2

Browse files
committed
---
yaml --- r: 106263 b: refs/heads/auto c: eed808b h: refs/heads/master i: 106261: 11407bb 106259: da8d8d4 106255: bdd4947 v: v3
1 parent 3777971 commit 4c547f2

File tree

2 files changed

+29
-12
lines changed

2 files changed

+29
-12
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 169f08dd59f287a65da5188ff453f38f4215250c
16+
refs/heads/auto: eed808b53242071290c333c634efd7d42a5be2d7
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/etc/install.sh

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -224,49 +224,66 @@ step_msg "validating $CFG_SELF args"
224224
validate_opt
225225

226226
# Sanity check: can we can write to the destination?
227-
mkdir -p "${CFG_PREFIX}/lib"
227+
umask 022 && mkdir -p "${CFG_PREFIX}/lib"
228+
need_ok "directory creation failed"
228229
touch "${CFG_PREFIX}/lib/rust-install-probe" 2> /dev/null
229230
if [ $? -ne 0 ]
230231
then
231232
err "can't write to destination. try again with 'sudo'."
232233
fi
233-
rm -r "${CFG_PREFIX}/lib/rust-install-probe"
234+
rm "${CFG_PREFIX}/lib/rust-install-probe"
234235
need_ok "failed to remove install probe"
235236

236237
# Sanity check: can we run these binaries?
237238
"${CFG_SRC_DIR}/bin/rustc" --version > /dev/null
238239
need_ok "can't run these binaries on this platform"
239240

240241

241-
# First, uninstall from the installation prefix
242+
# First, uninstall from the installation prefix.
243+
# Errors are warnings - try to rm everything in the manifest even if some fail.
242244
# FIXME: Hardcoded 'rustlib' ignores CFG_RUSTLIBDIR
243245
if [ -f "${CFG_PREFIX}/lib/rustlib/manifest" ]
244246
then
247+
# Iterate through installed manifest and remove files
245248
while read p; do
246-
msg "uninstall ${CFG_PREFIX}/$p"
247-
rm "${CFG_PREFIX}/$p"
248-
need_ok "failed to remove file"
249+
msg "removing ${CFG_PREFIX}/$p"
250+
if [ -f "${CFG_PREFIX}/$p" ]
251+
then
252+
rm "${CFG_PREFIX}/$p"
253+
if [ $? -ne 0 ]
254+
then
255+
warn "failed to remove ${CFG_PREFIX}/$p"
256+
fi
257+
else
258+
warn "supposedly installed file ${CFG_PREFIX}/$p does not exist!"
259+
fi
249260
done < "${CFG_PREFIX}/lib/rustlib/manifest"
250261

251262
# Remove 'rustlib' directory
252-
msg "uninstall ${CFG_PREFIX}/lib/rustlib"
263+
msg "removing ${CFG_PREFIX}/lib/rustlib"
253264
rm -r "${CFG_PREFIX}/lib/rustlib"
254-
need_ok "failed to remove rustlib"
265+
if [ $? -ne 0 ]
266+
then
267+
warn "failed to remove rustlib"
268+
fi
255269
else
256270
if [ -n "${CFG_UNINSTALL}" ]
257271
then
258-
err "unable to find manifest at ${CFG_PREFIX}/lib/rustlib"
259-
exit 0
272+
err "unable to find installation manifest at ${CFG_PREFIX}/lib/rustlib"
260273
fi
261274
fi
262275

263276
# If we're only uninstalling then exit
264277
if [ -n "${CFG_UNINSTALL}" ]
265278
then
279+
echo
280+
echo " Rust is uninstalled. Have a nice day."
281+
echo
266282
exit 0
267283
fi
268284

269-
# Iterate through the new manifest and install files
285+
286+
# Now install, iterate through the new manifest and copy files
270287
while read p; do
271288

272289
umask 022 && mkdir -p "${CFG_PREFIX}/$(dirname $p)"

0 commit comments

Comments
 (0)