]> git.lizzy.rs Git - rust.git/commitdiff
install: name the bundled manifest 'manifest.in'. Cleanup
authorBrian Anderson <banderson@mozilla.com>
Wed, 26 Mar 2014 19:06:35 +0000 (12:06 -0700)
committerBrian Anderson <banderson@mozilla.com>
Wed, 26 Mar 2014 21:59:08 +0000 (14:59 -0700)
The installed manifest is a different file, so they should have
different names. This should prevent various wierd conflicts in the future.

mk/dist.mk
mk/install.mk
src/etc/install.sh

index 10c1636a03a68dc7547718f86548a8311bfa41ee..a2048f7fb8f3a3a310da4e8c190d153ac6ab5e90 100644 (file)
@@ -199,9 +199,11 @@ dist-install-dir-$(1): PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD)
 dist-install-dir-$(1): PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD)
 dist-install-dir-$(1): PREPARE_CLEAN=true
 dist-install-dir-$(1): prepare-base-dir-$(1)
+# Write the install manifest, making sure the manifest contains itself
+       $$(Q)touch $$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE)/rustlib/manifest-$(1).in
        $$(Q)(cd $$(PREPARE_DEST_DIR)/ && find -type f | sed 's/^\.\///') \
-      > tmp/manifest-$(1) # NB Use a tmp file so `find` doesn't *find the manifest*
-       $$(Q)cp tmp/manifest-$(1) $$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE)/rustlib/manifest
+      > $$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE)/rustlib/manifest-$(1).in
+# Add remaining non-installed files
        $$(Q)$$(PREPARE_MAN_CMD) $$(S)COPYRIGHT $$(PREPARE_DEST_DIR)
        $$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-APACHE $$(PREPARE_DEST_DIR)
        $$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-MIT $$(PREPARE_DEST_DIR)
index 6545441a405b784432fa0439319150a26e1a6d90..e360afe291b7cf63bb56a77a55a5dddc08ce7b52 100644 (file)
@@ -11,6 +11,8 @@
 
 install: dist-install-dir-$(CFG_BUILD)
        $(Q)sh tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(CFG_PREFIX)" --libdir="$(CFG_LIBDIR)" --mandir="$(CFG_MANDIR)"
+# Remove tmp files while we can because they may have been created under sudo
+       $(Q)rm -R tmp/dist/$(PKG_NAME)-$(CFG_BUILD/
 
 uninstall: dist-install-dir-$(CFG_BUILD)
        $(Q)sh tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(CFG_PREFIX)" --libdir="$(CFG_LIBDIR)" --mandir="$(CFG_MANDIR)"
index 3ae028d971301535ff7c773f8379d7e45502643e..8bcb04eec903d596f453d8a2795b078e5cc566f8 100644 (file)
@@ -229,15 +229,16 @@ validate_opt
 
 # Sanity check: can we can write to the destination?
 umask 022 && mkdir -p "${CFG_LIBDIR}"
-need_ok "directory creation failed"
+need_ok "can't write to destination. consider `sudo`."
 touch "${CFG_LIBDIR}/rust-install-probe" 2> /dev/null
 if [ $? -ne 0 ]
 then
-    err "can't write to destination. try again with 'sudo'."
+    err "can't write to destination. consider `sudo`."
 fi
 rm "${CFG_LIBDIR}/rust-install-probe"
 need_ok "failed to remove install probe"
 
+# The file name of the manifest we're going to create during install
 INSTALLED_MANIFEST="${CFG_LIBDIR}/rustlib/manifest"
 
 # First, uninstall from the installation prefix.
@@ -267,6 +268,7 @@ then
         warn "failed to remove rustlib"
     fi
 else
+    # There's no manifest. If we were asked to uninstall, then that's a problem.
     if [ -n "${CFG_UNINSTALL}" ]
     then
         err "unable to find installation manifest at ${CFG_LIBDIR}/rustlib"
@@ -304,7 +306,7 @@ while read p; do
         FILE_INSTALL_PATH="${CFG_MANDIR}/$pp"
     fi
 
-    # Make sure ther's a directory for it
+    # Make sure there's a directory for it
     umask 022 && mkdir -p "$(dirname ${FILE_INSTALL_PATH})"
     need_ok "directory creation failed"
 
@@ -330,7 +332,7 @@ while read p; do
     need_ok "failed to update manifest"
 
 # The manifest lists all files to install
-done < "${CFG_SRC_DIR}/lib/rustlib/manifest"
+done < "${CFG_SRC_DIR}/lib/rustlib/manifest.in"
 
 echo
 echo "    Rust is ready to roll."