Skip to content

Commit b97adc8

Browse files
committed
---
yaml --- r: 150376 b: refs/heads/try2 c: c91ce02 h: refs/heads/master v: v3
1 parent 40d3006 commit b97adc8

File tree

2 files changed

+24
-10
lines changed

2 files changed

+24
-10
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: 766a7c224bb96d9a43a99e3032af07c477d2b04d
8+
refs/heads/try2: c91ce02600d5b41805c3d39f64fde5f9a1d01be8
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: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,16 @@ validate_opt () {
189189
done
190190
}
191191

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+
192202
CFG_SRC_DIR="$(cd $(dirname $0) && pwd)/"
193203
CFG_SELF="$0"
194204
CFG_ARGS="$@"
@@ -268,8 +278,13 @@ then
268278
err "can't install to same directory as installer"
269279
fi
270280

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+
271286
# 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"
273288

274289
# First, uninstall from the installation prefix.
275290
# Errors are warnings - try to rm everything in the manifest even if some fail.
@@ -293,14 +308,14 @@ then
293308

294309
# If we fail to remove rustlib below, then the installed manifest will
295310
# 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}"
298313
# For the above reason, this is a hard error
299314
need_ok "failed to remove installed manifest"
300315

301316
# 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"
304319
if [ $? -ne 0 ]
305320
then
306321
warn "failed to remove rustlib"
@@ -325,6 +340,7 @@ fi
325340
# Create the installed manifest, which we will fill in with absolute file paths
326341
mkdir -p "${CFG_LIBDIR}/rustlib"
327342
touch "${INSTALLED_MANIFEST}"
343+
need_ok "failed to create installed manifest"
328344

329345
# Now install, iterate through the new manifest and copy files
330346
while read p; do
@@ -350,10 +366,8 @@ while read p; do
350366

351367
# Make the path absolute so we can uninstall it later without
352368
# 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}"
357371

358372
# Install the file
359373
msg "${FILE_INSTALL_PATH}"

0 commit comments

Comments
 (0)