2010-12-21 04:19:50 -08:00
|
|
|
exec >&2
|
Directory reorg: move code into redo/, generate binaries in bin/.
It's time to start preparing for a version of redo that doesn't work
unless we build it first (because it will rely on C modules, and
eventually be rewritten in C altogether).
To get rolling, remove the old-style symlinks to the main programs, and
rename those programs from redo-*.py to redo/cmd_*.py. We'll also move
all library functions into the redo/ dir, which is a more python-style
naming convention.
Previously, install.do was generating wrappers for installing in
/usr/bin, which extend sys.path and then import+run the right file.
This made "installed" redo work quite differently from running redo
inside its source tree. Instead, let's always generate the wrappers in
bin/, and not make anything executable except those wrappers.
Since we're generating wrappers anyway, let's actually auto-detect the
right version of python for the running system; distros can't seem to
agree on what to call their python2 binaries (sigh). We'll fill in the
right #! shebang lines. Since we're doing that, we can stop using
/usr/bin/env, which will a) make things slightly faster, and b) let us
use "python -S", which tells python not to load a bunch of extra crap
we're not using, thus improving startup times.
Annoyingly, we now have to build redo using minimal/do, then run the
tests using bin/redo. To make this less annoying, we add a toplevel
./do script that knows the right steps, and a Makefile (whee!) for
people who are used to typing 'make' and 'make test' and 'make clean'.
2018-12-03 21:39:15 -05:00
|
|
|
redo-ifchange ../t/shelltest.od
|
2010-12-21 04:19:50 -08:00
|
|
|
|
Directory reorg: move code into redo/, generate binaries in bin/.
It's time to start preparing for a version of redo that doesn't work
unless we build it first (because it will rely on C modules, and
eventually be rewritten in C altogether).
To get rolling, remove the old-style symlinks to the main programs, and
rename those programs from redo-*.py to redo/cmd_*.py. We'll also move
all library functions into the redo/ dir, which is a more python-style
naming convention.
Previously, install.do was generating wrappers for installing in
/usr/bin, which extend sys.path and then import+run the right file.
This made "installed" redo work quite differently from running redo
inside its source tree. Instead, let's always generate the wrappers in
bin/, and not make anything executable except those wrappers.
Since we're generating wrappers anyway, let's actually auto-detect the
right version of python for the running system; distros can't seem to
agree on what to call their python2 binaries (sigh). We'll fill in the
right #! shebang lines. Since we're doing that, we can stop using
/usr/bin/env, which will a) make things slightly faster, and b) let us
use "python -S", which tells python not to load a bunch of extra crap
we're not using, thus improving startup times.
Annoyingly, we now have to build redo using minimal/do, then run the
tests using bin/redo. To make this less annoying, we add a toplevel
./do script that knows the right steps, and a Makefile (whee!) for
people who are used to typing 'make' and 'make test' and 'make clean'.
2018-12-03 21:39:15 -05:00
|
|
|
rm -rf $1.new
|
2010-12-21 04:19:50 -08:00
|
|
|
mkdir $1.new
|
|
|
|
|
|
|
|
|
|
GOOD=
|
|
|
|
|
WARN=
|
|
|
|
|
|
2011-05-08 01:25:26 -04:00
|
|
|
# Note: list low-functionality, maximally POSIX-like shells before more
|
|
|
|
|
# powerful ones. We want weaker shells to take precedence, as long as they
|
|
|
|
|
# pass the tests, because weaker shells are more likely to point out when you
|
|
|
|
|
# use some non-portable feature.
|
2018-10-12 03:49:22 -04:00
|
|
|
for sh in dash /usr/xpg4/bin/sh ash posh mksh ksh ksh88 ksh93 pdksh \
|
2018-12-04 02:31:41 -05:00
|
|
|
zsh bash busybox /bin/sh; do
|
2018-12-17 12:33:17 +00:00
|
|
|
printf " %-22s" "$sh..."
|
2011-01-02 11:49:51 -08:00
|
|
|
FOUND=`which $sh 2>/dev/null` || { echo "missing"; continue; }
|
2010-12-21 04:19:50 -08:00
|
|
|
|
2011-01-02 11:49:34 -08:00
|
|
|
# It's important for the file to actually be named 'sh'. Some
|
|
|
|
|
# shells (like bash and zsh) only go into POSIX-compatible mode if
|
|
|
|
|
# they have that name. If they're not in POSIX-compatible mode,
|
|
|
|
|
# they'll fail the test.
|
2010-12-21 04:19:50 -08:00
|
|
|
rm -f $1.new/sh
|
|
|
|
|
ln -s $FOUND $1.new/sh
|
Directory reorg: move code into redo/, generate binaries in bin/.
It's time to start preparing for a version of redo that doesn't work
unless we build it first (because it will rely on C modules, and
eventually be rewritten in C altogether).
To get rolling, remove the old-style symlinks to the main programs, and
rename those programs from redo-*.py to redo/cmd_*.py. We'll also move
all library functions into the redo/ dir, which is a more python-style
naming convention.
Previously, install.do was generating wrappers for installing in
/usr/bin, which extend sys.path and then import+run the right file.
This made "installed" redo work quite differently from running redo
inside its source tree. Instead, let's always generate the wrappers in
bin/, and not make anything executable except those wrappers.
Since we're generating wrappers anyway, let's actually auto-detect the
right version of python for the running system; distros can't seem to
agree on what to call their python2 binaries (sigh). We'll fill in the
right #! shebang lines. Since we're doing that, we can stop using
/usr/bin/env, which will a) make things slightly faster, and b) let us
use "python -S", which tells python not to load a bunch of extra crap
we're not using, thus improving startup times.
Annoyingly, we now have to build redo using minimal/do, then run the
tests using bin/redo. To make this less annoying, we add a toplevel
./do script that knows the right steps, and a Makefile (whee!) for
people who are used to typing 'make' and 'make test' and 'make clean'.
2018-12-03 21:39:15 -05:00
|
|
|
SH=$PWD/$1.new/sh
|
2010-12-21 04:19:50 -08:00
|
|
|
|
|
|
|
|
set +e
|
2018-12-11 01:19:58 +00:00
|
|
|
( cd ../t && "$SH" shelltest.od ) >shelltest.tmp 2>&1
|
2010-12-21 04:19:50 -08:00
|
|
|
RV=$?
|
|
|
|
|
set -e
|
|
|
|
|
|
2011-03-23 11:24:17 -07:00
|
|
|
msgs=
|
|
|
|
|
crash=
|
|
|
|
|
while read line; do
|
|
|
|
|
#echo "line: '$line'" >&2
|
|
|
|
|
stripw=${line#warning: }
|
|
|
|
|
stripf=${line#failed: }
|
|
|
|
|
crash=$line
|
2011-05-08 01:25:26 -04:00
|
|
|
[ "$line" = "$stripw" ] || msgs="$msgs W$stripw"
|
|
|
|
|
[ "$line" = "$stripf" ] || msgs="$msgs F$stripf"
|
Directory reorg: move code into redo/, generate binaries in bin/.
It's time to start preparing for a version of redo that doesn't work
unless we build it first (because it will rely on C modules, and
eventually be rewritten in C altogether).
To get rolling, remove the old-style symlinks to the main programs, and
rename those programs from redo-*.py to redo/cmd_*.py. We'll also move
all library functions into the redo/ dir, which is a more python-style
naming convention.
Previously, install.do was generating wrappers for installing in
/usr/bin, which extend sys.path and then import+run the right file.
This made "installed" redo work quite differently from running redo
inside its source tree. Instead, let's always generate the wrappers in
bin/, and not make anything executable except those wrappers.
Since we're generating wrappers anyway, let's actually auto-detect the
right version of python for the running system; distros can't seem to
agree on what to call their python2 binaries (sigh). We'll fill in the
right #! shebang lines. Since we're doing that, we can stop using
/usr/bin/env, which will a) make things slightly faster, and b) let us
use "python -S", which tells python not to load a bunch of extra crap
we're not using, thus improving startup times.
Annoyingly, we now have to build redo using minimal/do, then run the
tests using bin/redo. To make this less annoying, we add a toplevel
./do script that knows the right steps, and a Makefile (whee!) for
people who are used to typing 'make' and 'make test' and 'make clean'.
2018-12-03 21:39:15 -05:00
|
|
|
done <shelltest.tmp
|
|
|
|
|
rm -f shelltest.tmp
|
2011-03-23 11:24:17 -07:00
|
|
|
msgs=${msgs# }
|
|
|
|
|
crash=${crash##*:}
|
|
|
|
|
crash=${crash# }
|
|
|
|
|
|
2010-12-21 04:19:50 -08:00
|
|
|
case $RV in
|
2011-05-08 01:25:26 -04:00
|
|
|
40) echo "ok $msgs"; [ -n "$GOOD" ] || GOOD=$FOUND ;;
|
2011-03-23 11:24:17 -07:00
|
|
|
41) echo "failed $msgs" ;;
|
|
|
|
|
42) echo "warnings $msgs"; [ -n "$WARN" ] || WARN=$FOUND ;;
|
2011-04-17 23:39:53 -04:00
|
|
|
*) echo "crash $crash" ;;
|
2010-12-21 04:19:50 -08:00
|
|
|
esac
|
|
|
|
|
done
|
|
|
|
|
|
Directory reorg: move code into redo/, generate binaries in bin/.
It's time to start preparing for a version of redo that doesn't work
unless we build it first (because it will rely on C modules, and
eventually be rewritten in C altogether).
To get rolling, remove the old-style symlinks to the main programs, and
rename those programs from redo-*.py to redo/cmd_*.py. We'll also move
all library functions into the redo/ dir, which is a more python-style
naming convention.
Previously, install.do was generating wrappers for installing in
/usr/bin, which extend sys.path and then import+run the right file.
This made "installed" redo work quite differently from running redo
inside its source tree. Instead, let's always generate the wrappers in
bin/, and not make anything executable except those wrappers.
Since we're generating wrappers anyway, let's actually auto-detect the
right version of python for the running system; distros can't seem to
agree on what to call their python2 binaries (sigh). We'll fill in the
right #! shebang lines. Since we're doing that, we can stop using
/usr/bin/env, which will a) make things slightly faster, and b) let us
use "python -S", which tells python not to load a bunch of extra crap
we're not using, thus improving startup times.
Annoyingly, we now have to build redo using minimal/do, then run the
tests using bin/redo. To make this less annoying, we add a toplevel
./do script that knows the right steps, and a Makefile (whee!) for
people who are used to typing 'make' and 'make test' and 'make clean'.
2018-12-03 21:39:15 -05:00
|
|
|
rm -rf $1.new $3
|
2010-12-21 04:19:50 -08:00
|
|
|
|
|
|
|
|
if [ -n "$GOOD" ]; then
|
|
|
|
|
echo "Selected perfect shell: $GOOD"
|
Directory reorg: move code into redo/, generate binaries in bin/.
It's time to start preparing for a version of redo that doesn't work
unless we build it first (because it will rely on C modules, and
eventually be rewritten in C altogether).
To get rolling, remove the old-style symlinks to the main programs, and
rename those programs from redo-*.py to redo/cmd_*.py. We'll also move
all library functions into the redo/ dir, which is a more python-style
naming convention.
Previously, install.do was generating wrappers for installing in
/usr/bin, which extend sys.path and then import+run the right file.
This made "installed" redo work quite differently from running redo
inside its source tree. Instead, let's always generate the wrappers in
bin/, and not make anything executable except those wrappers.
Since we're generating wrappers anyway, let's actually auto-detect the
right version of python for the running system; distros can't seem to
agree on what to call their python2 binaries (sigh). We'll fill in the
right #! shebang lines. Since we're doing that, we can stop using
/usr/bin/env, which will a) make things slightly faster, and b) let us
use "python -S", which tells python not to load a bunch of extra crap
we're not using, thus improving startup times.
Annoyingly, we now have to build redo using minimal/do, then run the
tests using bin/redo. To make this less annoying, we add a toplevel
./do script that knows the right steps, and a Makefile (whee!) for
people who are used to typing 'make' and 'make test' and 'make clean'.
2018-12-03 21:39:15 -05:00
|
|
|
ln -s $GOOD $3
|
2010-12-21 04:19:50 -08:00
|
|
|
elif [ -n "$WARN" ]; then
|
|
|
|
|
echo "Selected mostly good shell: $WARN"
|
Directory reorg: move code into redo/, generate binaries in bin/.
It's time to start preparing for a version of redo that doesn't work
unless we build it first (because it will rely on C modules, and
eventually be rewritten in C altogether).
To get rolling, remove the old-style symlinks to the main programs, and
rename those programs from redo-*.py to redo/cmd_*.py. We'll also move
all library functions into the redo/ dir, which is a more python-style
naming convention.
Previously, install.do was generating wrappers for installing in
/usr/bin, which extend sys.path and then import+run the right file.
This made "installed" redo work quite differently from running redo
inside its source tree. Instead, let's always generate the wrappers in
bin/, and not make anything executable except those wrappers.
Since we're generating wrappers anyway, let's actually auto-detect the
right version of python for the running system; distros can't seem to
agree on what to call their python2 binaries (sigh). We'll fill in the
right #! shebang lines. Since we're doing that, we can stop using
/usr/bin/env, which will a) make things slightly faster, and b) let us
use "python -S", which tells python not to load a bunch of extra crap
we're not using, thus improving startup times.
Annoyingly, we now have to build redo using minimal/do, then run the
tests using bin/redo. To make this less annoying, we add a toplevel
./do script that knows the right steps, and a Makefile (whee!) for
people who are used to typing 'make' and 'make test' and 'make clean'.
2018-12-03 21:39:15 -05:00
|
|
|
ln -s $WARN $3
|
2010-12-21 04:19:50 -08:00
|
|
|
else
|
|
|
|
|
echo "No good shells found! Maybe install dash, bash, or zsh."
|
2011-05-08 01:25:26 -04:00
|
|
|
exit 13
|
2010-12-21 04:19:50 -08:00
|
|
|
fi
|