Skip to content

Commit 6eac8b0

Browse files
committed
---
yaml --- r: 105190 b: refs/heads/snap-stage3 c: c060e2e h: refs/heads/master v: v3
1 parent b6c9690 commit 6eac8b0

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
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 62f1d68439dcfd509eaca29887afa97f22938373
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 92d0ec2ec7d71c5e42f6a6682b081b8ef6212913
4+
refs/heads/snap-stage3: c060e2e5154f1a49ebcfa6f2d7b7a4e05f35ab14
55
refs/heads/try: db814977d07bd798feb24f6b74c00800ef458a13
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/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/snap-stage3/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)