Skip to content

Commit 8f3a7f0

Browse files
committed
---
yaml --- r: 150263 b: refs/heads/try2 c: eed808b h: refs/heads/master i: 150261: 1e96e37 150259: b857962 150255: 02840b5 v: v3
1 parent c5491bc commit 8f3a7f0

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
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 169f08dd59f287a65da5188ff453f38f4215250c
8+
refs/heads/try2: eed808b53242071290c333c634efd7d42a5be2d7
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/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)