Rename "$WHERE1" -> "$BASE".

This commit is contained in:
Eli Barzilay 2011-10-10 12:42:44 -04:00
parent 1a2d425ece
commit de40798d49

View File

@ -147,12 +147,12 @@ if test "$unixstyle" = "N"; then
fi fi
fi fi
# WHERE1 can be used with "$WHERE1/$TARGET" to avoid a double slash # BASE can be used with "$BASE/$TARGET" to avoid a double slash
case "$where" in case "$where" in
"" ) failwith "internal error (empty \$where)" ;; "" ) failwith "internal error (empty \$where)" ;;
"/" ) WHERE1="" ;; "/" ) BASE="" ;;
*"/" ) failwith "internal error (\$where ends in a slash)" ;; *"/" ) failwith "internal error (\$where ends in a slash)" ;;
"/"* ) WHERE1="$where" ;; "/"* ) BASE="$where" ;;
* ) failwith "internal error (\$where is not absolute)" ;; * ) failwith "internal error (\$where is not absolute)" ;;
esac esac
@ -169,20 +169,20 @@ fi
set_prefix() { set_prefix() {
where="$1" where="$1"
# default dirs -- mimic configure behavior # default dirs -- mimic configure behavior
bindir="$WHERE1/bin" bindir="$BASE/bin"
collectsdir="$WHERE1/lib/racket/collects" collectsdir="$BASE/lib/racket/collects"
if test -d "$WHERE1/share"; then docdir="$WHERE1/share/racket/doc" if test -d "$BASE/share"; then docdir="$BASE/share/racket/doc"
elif test -d "$WHERE1/doc"; then docdir="$WHERE1/doc/racket" elif test -d "$BASE/doc"; then docdir="$BASE/doc/racket"
else docdir="$WHERE1/share/racket/doc" else docdir="$BASE/share/racket/doc"
fi fi
libdir="$WHERE1/lib" libdir="$BASE/lib"
includerktdir="$WHERE1/include/racket" includerktdir="$BASE/include/racket"
librktdir="$WHERE1/lib/racket" librktdir="$BASE/lib/racket"
mandir="$WHERE1/man" mandir="$BASE/man"
# The source tree is always removed -- no point keeping it if it won't work # The source tree is always removed -- no point keeping it if it won't work
# if test -d "$WHERE1/share"; then srcdir="$WHERE1/share/racket/src" # if test -d "$BASE/share"; then srcdir="$BASE/share/racket/src"
# elif test -d "$WHERE1/src"; then srcdir="$WHERE1/src/racket" # elif test -d "$BASE/src"; then srcdir="$BASE/src/racket"
# else srcdir="$WHERE1/share/racket/src" # else srcdir="$BASE/share/racket/src"
# fi # fi
} }
@ -208,7 +208,7 @@ read_dir() {
read new_dir read new_dir
case "$new_dir" in case "$new_dir" in
"/"* ) echo "$new_dir" ;; "/"* ) echo "$new_dir" ;;
* ) echo "$WHERE1/$new_dir" ;; * ) echo "$BASE/$new_dir" ;;
esac esac
} }
@ -272,30 +272,30 @@ echo "ok."
unpack_installation() { unpack_installation() {
# test that no TARGET exists # test that no TARGET exists
if test -d "$WHERE1/$TARGET" || test -f "$WHERE1/$TARGET"; then if test -d "$BASE/$TARGET" || test -f "$BASE/$TARGET"; then
echon "\"$WHERE1/$TARGET\" exists, delete? " echon "\"$BASE/$TARGET\" exists, delete? "
read yesno read yesno
case "$yesno" in case "$yesno" in
[yY]*) [yY]*)
echon "Deleting old \"$WHERE1/$TARGET\"... " echon "Deleting old \"$BASE/$TARGET\"... "
"$rm" -rf "$WHERE1/$TARGET" \ "$rm" -rf "$BASE/$TARGET" \
|| failwith "could not delete \"$WHERE1/$TARGET\"." || failwith "could not delete \"$BASE/$TARGET\"."
echo "done." echo "done."
;; ;;
*) failwith "aborting because \"$WHERE1/$TARGET\" exists." ;; *) failwith "aborting because \"$BASE/$TARGET\" exists." ;;
esac esac
fi fi
# unpack # unpack
echon "Unpacking into \"$WHERE1/$TARGET\"... " echon "Unpacking into \"$BASE/$TARGET\"... "
rm_on_abort="$WHERE1/$TARGET" rm_on_abort="$BASE/$TARGET"
"$mkdir" "$WHERE1/$TARGET" "$mkdir" "$BASE/$TARGET"
"$tail" +"$BINSTARTLINE" "$0" | "$gunzip" -c \ "$tail" +"$BINSTARTLINE" "$0" | "$gunzip" -c \
| { cd "$WHERE1/$TARGET" | { cd "$BASE/$TARGET"
"$tar" xf - || failwith "problems during unpacking of binary archive." "$tar" xf - || failwith "problems during unpacking of binary archive."
} }
cd "$WHERE1/$TARGET" cd "$BASE/$TARGET"
test -d "collects" \ test -d "collects" \
|| failwith "unpack failed (could not find \"$WHERE1/$TARGET/collects\")." || failwith "unpack failed (could not find \"$BASE/$TARGET/collects\")."
echo "done." echo "done."
} }
@ -346,15 +346,15 @@ if test ! "x$sysdir" = "x"; then
echo "Installing links in \"$sysdir/bin\"..." echo "Installing links in \"$sysdir/bin\"..."
printsep=" " printsep=" "
cd "bin" cd "bin"
for x in `cd "$WHERE1/$TARGET/bin"; ls`; do for x in `cd "$BASE/$TARGET/bin"; ls`; do
if test -x "$WHERE1/$TARGET/bin/$x"; then if test -x "$BASE/$TARGET/bin/$x"; then
echon "${printsep}$x" echon "${printsep}$x"
printsep=", " printsep=", "
link "$WHERE1/$TARGET/bin/$x" "$x" "$sysdir/bin" link "$BASE/$TARGET/bin/$x" "$x" "$sysdir/bin"
fi fi
done done
echo "" echo ""
echo "Done. (see \"$WHERE1/$TARGET/bin\" for other executables)" echo "Done. (see \"$BASE/$TARGET/bin\" for other executables)"
else else
echo "Skipping \"$sysdir/bin\" (does not exist or not writable)." echo "Skipping \"$sysdir/bin\" (does not exist or not writable)."
fi fi
@ -374,10 +374,10 @@ if test ! "x$sysdir" = "x"; then
cd "$mandir" cd "$mandir"
echo "Installing links in \"$sysdir/$mandir\"..." echo "Installing links in \"$sysdir/$mandir\"..."
printsep=" " printsep=" "
for x in `cd "$WHERE1/$TARGET/man/man1/"; "$ls"`; do for x in `cd "$BASE/$TARGET/man/man1/"; "$ls"`; do
echon "${printsep}$x" echon "${printsep}$x"
printsep=", " printsep=", "
link "$WHERE1/$TARGET/man/man1/$x" "$x" "$sysdir/$mandir" link "$BASE/$TARGET/man/man1/$x" "$x" "$sysdir/$mandir"
done done
echo "" echo ""
echo "Done" echo "Done"
@ -396,7 +396,7 @@ if test ! "x$sysdir" = "x"; then
else else
cd "$libdir" cd "$libdir"
echo "Installing \"$sysdir/$libdir/$TARGET\"." echo "Installing \"$sysdir/$libdir/$TARGET\"."
link "$WHERE1/$TARGET/lib" "$TARGET" "$sysdir/$libdir" link "$BASE/$TARGET/lib" "$TARGET" "$sysdir/$libdir"
fi fi
# include link # include link
cd "$sysdir" cd "$sysdir"
@ -413,7 +413,7 @@ if test ! "x$sysdir" = "x"; then
else else
cd "$incdir" cd "$incdir"
echo "Installing \"$sysdir/$incdir/$TARGET\"." echo "Installing \"$sysdir/$incdir/$TARGET\"."
link "$WHERE1/$TARGET/include" "$TARGET" "$sysdir/$incdir" link "$BASE/$TARGET/include" "$TARGET" "$sysdir/$incdir"
fi fi
# doc link # doc link
cd "$sysdir" cd "$sysdir"
@ -429,7 +429,7 @@ if test ! "x$sysdir" = "x"; then
else else
cd "$docdir" cd "$docdir"
echo "Installing \"$sysdir/$docdir/$TARGET\"." echo "Installing \"$sysdir/$docdir/$TARGET\"."
link "$WHERE1/$TARGET/notes" "$TARGET" "$sysdir/$docdir" link "$BASE/$TARGET/notes" "$TARGET" "$sysdir/$docdir"
fi fi
fi fi
@ -441,12 +441,12 @@ fi
unixstyle_install() { unixstyle_install() {
TARGET="$TARGET-tmp-install" TARGET="$TARGET-tmp-install"
if test -e "$WHERE1/$TARGET"; then if test -e "$BASE/$TARGET"; then
echo "\"$WHERE1/$TARGET\" already exists (needed for the installation)," echo "\"$BASE/$TARGET\" already exists (needed for the installation),"
echon " ok to remove? " echon " ok to remove? "
read R read R
case "$R" in case "$R" in
[yY]* ) "$rm" -rf "$WHERE1/$TARGET" ;; [yY]* ) "$rm" -rf "$BASE/$TARGET" ;;
* ) failwith "abort..." ;; * ) failwith "abort..." ;;
esac esac
fi fi
@ -468,7 +468,7 @@ unpack_installation
cd "$where" cd "$where"
"$TARGET/bin/racket" "$TARGET/collects/setup/unixstyle-install.rkt" \ "$TARGET/bin/racket" "$TARGET/collects/setup/unixstyle-install.rkt" \
"move" "$WHERE1/$TARGET" "$bindir" "$collectsdir" "$docdir" "$libdir" \ "move" "$BASE/$TARGET" "$bindir" "$collectsdir" "$docdir" "$libdir" \
"$includerktdir" "$librktdir" "$mandir" \ "$includerktdir" "$librktdir" "$mandir" \
|| failwith "installation failed" || failwith "installation failed"