Skip to content

Commit be5a06c

Browse files
committed
---
yaml --- r: 150328 b: refs/heads/try2 c: c060e2e h: refs/heads/master v: v3
1 parent aa6d968 commit be5a06c

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
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: 92d0ec2ec7d71c5e42f6a6682b081b8ef6212913
8+
refs/heads/try2: c060e2e5154f1a49ebcfa6f2d7b7a4e05f35ab14
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/mk/dist.mk

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,9 @@ dist-install-dir-$(1): PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD)
199199
dist-install-dir-$(1): PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD)
200200
dist-install-dir-$(1): PREPARE_CLEAN=true
201201
dist-install-dir-$(1): prepare-base-dir-$(1)
202-
# Write the install manifest, making sure the manifest contains itself
203-
$$(Q)touch $$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE)/rustlib/manifest-$(1).in
204202
$$(Q)(cd $$(PREPARE_DEST_DIR)/ && find -type f | sed 's/^\.\///') \
205-
> $$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE)/rustlib/manifest-$(1).in
203+
> tmp/dist/manifest-$(1).in
204+
$$(Q)mv tmp/dist/manifest-$(1).in $$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE)/rustlib/manifest.in
206205
# Add remaining non-installed files
207206
$$(Q)$$(PREPARE_MAN_CMD) $$(S)COPYRIGHT $$(PREPARE_DEST_DIR)
208207
$$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-APACHE $$(PREPARE_DEST_DIR)

branches/try2/src/etc/install.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,17 +227,29 @@ fi
227227
step_msg "validating $CFG_SELF args"
228228
validate_opt
229229

230+
231+
# OK, let's get installing ...
232+
230233
# Sanity check: can we can write to the destination?
231234
umask 022 && mkdir -p "${CFG_LIBDIR}"
232-
need_ok "can't write to destination. consider `sudo`."
235+
need_ok "can't write to destination. consider 'sudo'."
233236
touch "${CFG_LIBDIR}/rust-install-probe" 2> /dev/null
234237
if [ $? -ne 0 ]
235238
then
236-
err "can't write to destination. consider `sudo`."
239+
err "can't write to destination. consider 'sudo'."
237240
fi
238241
rm "${CFG_LIBDIR}/rust-install-probe"
239242
need_ok "failed to remove install probe"
240243

244+
# Sanity check: don't install to the directory containing the installer.
245+
# That would surely cause chaos.
246+
INSTALLER_DIR="$(cd $(dirname $0) && pwd)"
247+
PREFIX_DIR="$(cd ${CFG_PREFIX} && pwd)"
248+
if [ "${INSTALLER_DIR}" = "${PREFIX_DIR}" ]
249+
then
250+
err "can't install to same directory as installer"
251+
fi
252+
241253
# The file name of the manifest we're going to create during install
242254
INSTALLED_MANIFEST="${CFG_LIBDIR}/rustlib/manifest"
243255

0 commit comments

Comments
 (0)