]> git.proxmox.com Git - rustc.git/blobdiff - src/rust-installer/gen-installer.sh
New upstream version 1.12.0+dfsg1
[rustc.git] / src / rust-installer / gen-installer.sh
index 9f2b1f621e327cae59b421d3aca3faa9933b64c4..727e7e36b2e9c9ca3e02456a46bb57977921d8ae 100755 (executable)
@@ -9,13 +9,7 @@
 # option. This file may not be copied, modified, or distributed
 # except according to those terms.
 
-set -u
-
-if [ -x /bin/echo ]; then
-    ECHO='/bin/echo'
-else
-    ECHO='echo'
-fi
+set -ue
 
 msg() {
     echo "gen-installer: ${1-}"
@@ -296,9 +290,8 @@ for bulk_dir in $bulk_dirs; do
     manifest=`echo "$manifest" | sed /^$bulk_dir/d`
 done
 
-# Add 'file:' installation directives.
-# The -n prevents adding a blank file: if the manifest is empty
-manifest=`$ECHO -n "$manifest" | sed s/^/file:/`
+# Add 'file:' installation directives, skipping empty lines.
+manifest=`echo "$manifest" | sed /^$/d | sed s/^/file:/`
 
 # Add 'dir:' directives
 for bulk_dir in $bulk_dirs; do