File tree 2 files changed +16
-5
lines changed
2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -199,10 +199,9 @@ dist-install-dir-$(1): PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD)
199
199
dist-install-dir-$(1 ) : PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD )
200
200
dist-install-dir-$(1 ) : PREPARE_CLEAN=true
201
201
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
204
202
$$(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
206
205
# Add remaining non-installed files
207
206
$$(Q )$$(PREPARE_MAN_CMD ) $$(S ) COPYRIGHT $$(PREPARE_DEST_DIR )
208
207
$$(Q )$$(PREPARE_MAN_CMD ) $$(S ) LICENSE-APACHE $$(PREPARE_DEST_DIR )
Original file line number Diff line number Diff line change 227
227
step_msg " validating $CFG_SELF args"
228
228
validate_opt
229
229
230
+
231
+ # OK, let's get installing ...
232
+
230
233
# Sanity check: can we can write to the destination?
231
234
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' ."
233
236
touch " ${CFG_LIBDIR} /rust-install-probe" 2> /dev/null
234
237
if [ $? -ne 0 ]
235
238
then
236
- err " can't write to destination. consider ` sudo` ."
239
+ err " can't write to destination. consider ' sudo' ."
237
240
fi
238
241
rm " ${CFG_LIBDIR} /rust-install-probe"
239
242
need_ok " failed to remove install probe"
240
243
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
+
241
253
# The file name of the manifest we're going to create during install
242
254
INSTALLED_MANIFEST=" ${CFG_LIBDIR} /rustlib/manifest"
243
255
You can’t perform that action at this time.
0 commit comments