Brandon Casey [off-list ref] writes:
quoted
This seems to break t9001. Near the tip of 'pu' I have a iffy
workaround.
Can you squash this into your 'iffy' workaround to help platforms
(Solaris 7, IRIX 6.5) without the 'yes' utility?
Not in this form, for two reasons ;-)
(1) t7610-mergetool.sh,also seems to use "yes". Perhaps define something
in test-lib.sh?
(2) The implementation is iffy.
+yes () {
+ test -n "$*" && y="$*" || y='y'
Shouldn't it be
if test $# = 0
then
y=y
else
y="$*"
fi
so that
yes ""
would give runs of empty lines?
Junio C Hamano wrote:
Brandon Casey [off-list ref] writes:
quoted
quoted
This seems to break t9001. Near the tip of 'pu' I have a iffy
workaround.
Can you squash this into your 'iffy' workaround to help platforms
(Solaris 7, IRIX 6.5) without the 'yes' utility?
Not in this form, for two reasons ;-)
(1) t7610-mergetool.sh,also seems to use "yes". Perhaps define something
in test-lib.sh?
(2) The implementation is iffy.
Looks good, I'll rework it sometime if you don't beat me to it.
-brandon
quoted
+yes () {
+ test -n "$*" && y="$*" || y='y'
Shouldn't it be
if test $# = 0
then
y=y
else
y="$*"
fi
so that
yes ""
would give runs of empty lines?
From: Brandon Casey <redacted>
Some platforms (IRIX 6.5, Solaris 7) do not provide the 'yes' utility.
Currently, some tests, including t7610 and t9001, try to call this program.
Due to the way the tests are structured, the tests still pass even though
this program is missing. Rather than succeeding by chance, let's provide
an implementation of the simple 'yes' utility in shell for all platforms to
use.
Signed-off-by: Brandon Casey <redacted>
---
t/test-lib.sh | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/t/test-lib.sh b/t/test-lib.sh
index a5b8d03..f2ca536 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -685,6 +685,21 @@ do
esac
done
+# Provide an implementation of the 'yes' utility
+yes () {
+ if test $# = 0
+ then
+ y=y
+ else
+ y="$*"
+ fi
+
+ while echo "$y"
+ do
+ :
+ done
+}
+
# Fix some commands on Windows
case $(uname -s) in
*MINGW*)--
1.6.4