[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 5342fb09 1/2: Revert "Check /dev/tty before w
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 5342fb09 1/2: Revert "Check /dev/tty before writing to it" |
Date: |
Thu, 19 Jan 2023 08:09:07 -0500 (EST) |
branch: master
commit 5342fb09c20e7660d073b965e1fd6baa9fb67d73
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Revert "Check /dev/tty before writing to it"
This reverts commit c9fe5f53e2c8faa3265cd68f54d5d6f7014a2765.
The problem with
tty -s && echo "whatever" >/dev/tty
is that when 'tty' doesn't return 0, the return code for the entire
command is nonzero, apparently causing 'set -e' scripts to abend.
---
gwc/install_posix.sh | 2 +-
gwc/speed_test.sh | 2 +-
gwc/toms_vs_brent.sh | 8 ++++----
gwc/unit_test.sh | 2 +-
install_msw.sh | 4 ++--
nychthemeral_test.sh | 2 +-
6 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/gwc/install_posix.sh b/gwc/install_posix.sh
index 12139905..29b0cdf6 100755
--- a/gwc/install_posix.sh
+++ b/gwc/install_posix.sh
@@ -246,4 +246,4 @@ seconds=$(($(date '+%s' -d "$stamp1") - $(date '+%s' -d
"$stamp0")))
elapsed=$(date -u -d @"$seconds" +'%H:%M:%S')
echo "Elapsed: $elapsed"
-tty -s && echo Finished building lmi. >/dev/tty
+echo Finished building lmi. >/dev/tty
diff --git a/gwc/speed_test.sh b/gwc/speed_test.sh
index ab771784..fd40e75f 100755
--- a/gwc/speed_test.sh
+++ b/gwc/speed_test.sh
@@ -24,7 +24,7 @@ case "$toolchain" in
;;
esac
{
-tty -s && printf 'toolchain = "%s"\n' "$toolchain" > /dev/tty
+printf 'toolchain = "%s"\n' "$toolchain" > /dev/tty
# shellcheck disable=SC2154
make "$coefficiency" cli_timing > /dev/null
}
diff --git a/gwc/toms_vs_brent.sh b/gwc/toms_vs_brent.sh
index 003971f7..77f55231 100755
--- a/gwc/toms_vs_brent.sh
+++ b/gwc/toms_vs_brent.sh
@@ -6,9 +6,9 @@
# then extract the results of the tests in the TOMS 748 paper and
# save them to distinct files.
-tty -s && printf 'i686-w64-mingw32 no longer supported; do' > /dev/tty
-tty -s && printf ' "git switch --detach 72547df8069cfb"' > /dev/tty
-tty -s && printf 'if you require i686+x87 timings.' > /dev/tty
+printf 'i686-w64-mingw32 no longer supported; do' > /dev/tty
+printf ' "git switch --detach 72547df8069cfb"' > /dev/tty
+printf 'if you require i686+x87 timings.' > /dev/tty
# 'triplets' really is used, but in a zsh-specific way
# shellcheck disable=SC2034
@@ -20,7 +20,7 @@ for LMI_TRIPLET in ${=triplets} ;
do
log_dir=$(dirname "$(readlink --canonicalize "$0")")
{
-tty -s && printf 'LMI_TRIPLET = "%s"\n' "$LMI_TRIPLET" > /dev/tty
+printf 'LMI_TRIPLET = "%s"\n' "$LMI_TRIPLET" > /dev/tty
make clean
# shellcheck disable=SC2039,SC2154,SC3001
diff --git a/gwc/unit_test.sh b/gwc/unit_test.sh
index a49e8dc2..632d1dfb 100755
--- a/gwc/unit_test.sh
+++ b/gwc/unit_test.sh
@@ -31,7 +31,7 @@ exec_prefix="$prefix/${LMI_COMPILER}_${LMI_TRIPLET}"
log_dir="$exec_prefix"/logs
mkdir --parents "$log_dir"
{
-tty -s && printf 'toolchain: %s\n' "${LMI_COMPILER}_${LMI_TRIPLET}" > /dev/tty
+printf 'toolchain: %s\n' "${LMI_COMPILER}_${LMI_TRIPLET}" > /dev/tty
# shellcheck disable=SC2039,SC2154,SC3001
make "$coefficiency" --output-sync=recurse unit_tests 2>&1 \
| tee \
diff --git a/install_msw.sh b/install_msw.sh
index 567373a7..0e9298be 100755
--- a/install_msw.sh
+++ b/install_msw.sh
@@ -249,7 +249,7 @@ then
restore_cache_mount=$(mount --mount-entries | grep '/srv/cache_for_lmi ')
[ -z "$restore_cache_mount" ] \
|| printf '%s\n' "$restore_cache_mount" | grep --silent
'C:/srv/cache_for_lmi' \
- || printf 'Replacing former cache mount:\n %s\n' "$restore_cache_mount"
+ || printf 'Replacing former cache mount:\n %s\n' "$restore_cache_mount"
>/dev/tty
mount --force "C:/srv/cache_for_lmi" "/srv/cache_for_lmi"
fi
@@ -439,4 +439,4 @@ seconds=$(($(date '+%s' -d "$stamp1") - $(date '+%s' -d
"$stamp0")))
elapsed=$(date -u -d @"$seconds" +'%H:%M:%S')
echo "Elapsed: $elapsed"
-tty -s && echo Finished building lmi. >/dev/tty
+echo Finished building lmi. >/dev/tty
diff --git a/nychthemeral_test.sh b/nychthemeral_test.sh
index fbfae703..e9804e10 100755
--- a/nychthemeral_test.sh
+++ b/nychthemeral_test.sh
@@ -326,7 +326,7 @@ exec_prefix="$prefix/${LMI_COMPILER}_${LMI_TRIPLET}"
log_dir="$exec_prefix"/logs
mkdir --parents "$log_dir"
{
-tty -s && printf 'toolchain: %s\n' "${LMI_COMPILER}_${LMI_TRIPLET}" > /dev/tty
+printf 'toolchain: %s\n' "${LMI_COMPILER}_${LMI_TRIPLET}" > /dev/tty
# Cannot recursively check script on path determined at runtime, so
# a directive like 'source="$srcdir"' doesn't work.