From f882c01e654890d3076db856bb6b9414236fee3a Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Tue, 11 Oct 2011 17:13:10 -0400 Subject: [PATCH] Misc improvements (no functionality changes, yet). --- .../build/unix-installer/installer-header | 68 +++++++++---------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/collects/meta/build/unix-installer/installer-header b/collects/meta/build/unix-installer/installer-header index ecd42048d4..9da4b97dc6 100644 --- a/collects/meta/build/unix-installer/installer-header +++ b/collects/meta/build/unix-installer/installer-header @@ -4,7 +4,7 @@ PATH=/usr/bin:/bin -if [ "x`echo -n`" = "x-n" ]; then +if test "x`echo -n`" = "x-n"; then echon() { /bin/echo "$*\c"; } else echon() { echo -n "$*"; } @@ -27,16 +27,16 @@ exithandler() { trap exithandler 2 3 9 15 lookfor() { - save_IFS="${IFS}" + saved_IFS="${IFS}" IFS=":" for dir in $PATH; do if test -x "$dir/$1"; then eval "$1=$dir/$1" - IFS="$save_IFS" + IFS="$saved_IFS" return fi done - IFS="$save_IFS" + IFS="$saved_IFS" failwith "could not find \"$1\"." } @@ -65,7 +65,7 @@ origwd="`pwd`" echo "This program will extract and install $DISTNAME." echo "" -echo "Note: the required diskspace for this installation is about $ORIGSIZE." +echo "Note: the required diskspace for this installation is $ORIGSIZE." ############################################################################### ## What kind of installation? @@ -76,9 +76,9 @@ echo " In this distribution mode files go into different directories according" echo " to Unix conventions. A \"racket-uninstall\" script will be generated" echo " to be used when you want to remove the installation. If you say 'no'," echo " the whole Racket directory is kept in a single installation directory" -echo " (movable and erasable) unit, possibly with convenient external links" -echo " into it -- this is often more convenient, especially if you want to" -echo " install multiple versions or keep it in your home directory." +echo " (movable and erasable), possibly with external links into it -- this is" +echo " often more convenient, especially if you want to install multiple" +echo " versions or keep it in your home directory." if test ! "x$RELEASED" = "xyes"; then echo "*** This is a nightly build: such a unix-style distribution is *not*" echo "*** recommended because it cannot be used to install multiple versions." @@ -101,9 +101,8 @@ done echo "" if test "$unixstyle" = "Y"; then echo "Where do you want to base your installation of $DISTNAME?" - echo " (Use an existing directory. If you've done such an installation in" - echo " the past, either use the same place, or manually run" - echo " 'racket-uninstall' now.)" + echo " (If you've done such an installation in the past, either" + echo " enter the same directory, or run 'racket-uninstall' manually.)" TARGET1="..." else echo "Where do you want to install the \"$TARGET\" directory tree?" @@ -167,7 +166,7 @@ fi ## Deal with Unix-style path questions set_prefix() { - where="$1" + BASE="$1" # default dirs -- mimic configure behavior bindir="$BASE/bin" collectsdir="$BASE/lib/racket/collects" @@ -205,6 +204,7 @@ show_dir_var() { } read_dir() { + echon "New directory: " read new_dir case "$new_dir" in "/"* ) echo "$new_dir" ;; @@ -213,7 +213,7 @@ read_dir() { } if test "$unixstyle" = "Y"; then - set_prefix "$where" + set_prefix "$BASE" # loop for possible changes done="N" while test ! "$done" = "Y"; do @@ -232,19 +232,19 @@ if test "$unixstyle" = "Y"; then # show_dir_var "[r] Source Tree " "$srcdir" fi if test "$err" = "Y"; then echo "*** Errors in some paths ***"; fi - echo "Enter a new prefix, a letter to change an entry, enter to continue" + echo "Enter a letter to change an entry, a new prefix, or enter to continue" echon "> " read change_what case "$change_what" in - [eE]* ) echon "New directory: "; bindir="`read_dir`" ;; - [sS]* ) echon "New directory: "; collectsdir="`read_dir`" ;; - [dD]* ) echon "New directory: "; docdir="`read_dir`" ;; - [lL]* ) echon "New directory: "; libdir="`read_dir`" ;; - [hH]* ) echon "New directory: "; includerktdir="`read_dir`" ;; - [oO]* ) echon "New directory: "; librktdir="`read_dir`" ;; - [mM]* ) echon "New directory: "; mandir="`read_dir`" ;; + [eE]* ) bindir="`read_dir`" ;; + [sS]* ) collectsdir="`read_dir`" ;; + [dD]* ) docdir="`read_dir`" ;; + [lL]* ) libdir="`read_dir`" ;; + [hH]* ) includerktdir="`read_dir`" ;; + [oO]* ) librktdir="`read_dir`" ;; + [mM]* ) mandir="`read_dir`" ;; # [rR]* ) if test "$PNAME" = "full"; then - # echon "New directory: "; srcdir="`read_dir`" + # srcdir="`read_dir`" # else # echo "Invalid response" # fi ;; @@ -268,21 +268,21 @@ test "$BINSUM" = "$SUM" || failwith "bad CRC checksum." echo "ok." ############################################################################### -## Unpacking into $where/$TARGET +## Unpacking into $BASE/$TARGET unpack_installation() { # test that no TARGET exists if test -d "$BASE/$TARGET" || test -f "$BASE/$TARGET"; then echon "\"$BASE/$TARGET\" exists, delete? " - read yesno - case "$yesno" in - [yY]*) + read R + case "$R" in + [yY]* ) echon "Deleting old \"$BASE/$TARGET\"... " "$rm" -rf "$BASE/$TARGET" \ || failwith "could not delete \"$BASE/$TARGET\"." echo "done." ;; - *) failwith "aborting because \"$BASE/$TARGET\" exists." ;; + * ) failwith "aborting because \"$BASE/$TARGET\" exists." ;; esac fi # unpack @@ -307,14 +307,14 @@ wholedir_install() { unpack_installation rm_on_abort="" -cd "$where" +cd "$BASE" if test -d "bin"; then echo "Do you want to install new system links within the bin, lib, include," - echo " man, and doc subdirectories of \"$where\", possibly overriding" + echo " man, and doc subdirectories of \"$BASE\", possibly overriding" echon " existing links? " - read yesno - case "$yesno" in - [yY]* ) sysdir="$where" ;; + read R + case "$R" in + [yY]* ) sysdir="$BASE" ;; * ) sysdir="" ;; esac else @@ -429,7 +429,7 @@ if test ! "x$sysdir" = "x"; then else cd "$docdir" echo "Installing \"$sysdir/$docdir/$TARGET\"." - link "$BASE/$TARGET/notes" "$TARGET" "$sysdir/$docdir" + link "$BASE/$TARGET/doc" "$TARGET" "$sysdir/$docdir" fi fi @@ -466,7 +466,7 @@ fi unpack_installation -cd "$where" +cd "$BASE" "$TARGET/bin/racket" "$TARGET/collects/setup/unixstyle-install.rkt" \ "move" "$BASE/$TARGET" "$bindir" "$collectsdir" "$docdir" "$libdir" \ "$includerktdir" "$librktdir" "$mandir" \