@@ -189,6 +189,16 @@ validate_opt () {
189
189
done
190
190
}
191
191
192
+ absolutify () {
193
+ FILE_PATH=" ${1} "
194
+ FILE_PATH_DIRNAME=" $( dirname ${FILE_PATH} ) "
195
+ FILE_PATH_BASENAME=" $( basename ${FILE_PATH} ) "
196
+ FILE_ABS_PATH=" $( cd ${FILE_PATH_DIRNAME} && pwd) "
197
+ FILE_PATH=" ${FILE_ABS_PATH} /${FILE_PATH_BASENAME} "
198
+ # This is the return value
199
+ ABSOLUTIFIED=" ${FILE_PATH} "
200
+ }
201
+
192
202
CFG_SRC_DIR=" $( cd $( dirname $0 ) && pwd) /"
193
203
CFG_SELF=" $0 "
194
204
CFG_ARGS=" $@ "
@@ -268,8 +278,13 @@ then
268
278
err " can't install to same directory as installer"
269
279
fi
270
280
281
+ # Using an absolute path to libdir in a few places so that the status
282
+ # messages are consistently using absolute paths.
283
+ absolutify " ${CFG_LIBDIR} "
284
+ ABS_LIBDIR=" ${ABSOLUTIFIED} "
285
+
271
286
# The file name of the manifest we're going to create during install
272
- INSTALLED_MANIFEST=" ${CFG_LIBDIR } /rustlib/manifest"
287
+ INSTALLED_MANIFEST=" ${ABS_LIBDIR } /rustlib/manifest"
273
288
274
289
# First, uninstall from the installation prefix.
275
290
# Errors are warnings - try to rm everything in the manifest even if some fail.
@@ -293,14 +308,14 @@ then
293
308
294
309
# If we fail to remove rustlib below, then the installed manifest will
295
310
# still be full; the installed manifest needs to be empty before install.
296
- msg " removing ${CFG_LIBDIR} /rustlib/manifest "
297
- rm -f " ${CFG_LIBDIR} /rustlib/manifest "
311
+ msg " removing ${INSTALLED_MANIFEST} "
312
+ rm -f " ${INSTALLED_MANIFEST} "
298
313
# For the above reason, this is a hard error
299
314
need_ok " failed to remove installed manifest"
300
315
301
316
# Remove 'rustlib' directory
302
- msg " removing ${CFG_LIBDIR } /rustlib"
303
- rm -Rf " ${CFG_LIBDIR } /rustlib"
317
+ msg " removing ${ABS_LIBDIR } /rustlib"
318
+ rm -Rf " ${ABS_LIBDIR } /rustlib"
304
319
if [ $? -ne 0 ]
305
320
then
306
321
warn " failed to remove rustlib"
325
340
# Create the installed manifest, which we will fill in with absolute file paths
326
341
mkdir -p " ${CFG_LIBDIR} /rustlib"
327
342
touch " ${INSTALLED_MANIFEST} "
343
+ need_ok " failed to create installed manifest"
328
344
329
345
# Now install, iterate through the new manifest and copy files
330
346
while read p; do
@@ -350,10 +366,8 @@ while read p; do
350
366
351
367
# Make the path absolute so we can uninstall it later without
352
368
# starting from the installation cwd
353
- FILE_INSTALL_PATH_DIRNAME=" $( dirname ${FILE_INSTALL_PATH} ) "
354
- FILE_INSTALL_PATH_BASENAME=" $( basename ${FILE_INSTALL_PATH} ) "
355
- FILE_INSTALL_ABS_PATH=" $( cd ${FILE_INSTALL_PATH_DIRNAME} && pwd) "
356
- FILE_INSTALL_PATH=" ${FILE_INSTALL_ABS_PATH} /${FILE_INSTALL_PATH_BASENAME} "
369
+ absolutify " ${FILE_INSTALL_PATH} "
370
+ FILE_INSTALL_PATH=" ${ABSOLUTIFIED} "
357
371
358
372
# Install the file
359
373
msg " ${FILE_INSTALL_PATH} "
0 commit comments