aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Mike Kelly <pioto@pioto.org> 2008-08-25 21:34:52 -0400
committerAvatar Mike Kelly <pioto@pioto.org> 2008-08-25 21:48:04 -0400
commit16ffcdb662b30773a9d9e91eabcfff6baf85df86 (patch)
tree2cd38aac468a1725d70fda6f43cd8aa3e21e4dc5
parent2dff4c53f99e35f801dbbeba9132c1ac75719eba (diff)
downloadpaludis-16ffcdb662b30773a9d9e91eabcfff6baf85df86.tar.gz
paludis-16ffcdb662b30773a9d9e91eabcfff6baf85df86.tar.xz
FreeBSD can't give head.
The head -c1 in FreeBSD doesn't read null characters properly. Use bash's 'read' builtin instead.
-rwxr-xr-xpaludis/util/system_TEST_setup.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/paludis/util/system_TEST_setup.sh b/paludis/util/system_TEST_setup.sh
index 5bdc42a..7bee967 100755
--- a/paludis/util/system_TEST_setup.sh
+++ b/paludis/util/system_TEST_setup.sh
@@ -10,7 +10,7 @@ cat <<'END' > pipe_test.bash
echo "$1" | tr "\n" "\0" 1>&$PALUDIS_PIPE_COMMAND_WRITE_FD
response1=
while true ; do
- c=$(head -c1 <&$PALUDIS_PIPE_COMMAND_READ_FD )
+ read -n 1 -u $PALUDIS_PIPE_COMMAND_READ_FD c
[[ "$c" == $'\0' ]] && break
response1="${response1}${c}"
done
@@ -18,7 +18,7 @@ done
echo "$2" | tr "\n" "\0" 1>&$PALUDIS_PIPE_COMMAND_WRITE_FD
response2=
while true ; do
- c=$(head -c1 <&$PALUDIS_PIPE_COMMAND_READ_FD )
+ read -n 1 -u $PALUDIS_PIPE_COMMAND_READ_FD c
[[ "$c" == $'\0' ]] && break
response2="${response2}${c}"
done
@@ -32,7 +32,7 @@ cat <<'END' > captured_pipe_test.bash
echo "$1" | tr "\n" "\0" 1>&$PALUDIS_PIPE_COMMAND_WRITE_FD
response1=
while true ; do
- c=$(head -c1 <&$PALUDIS_PIPE_COMMAND_READ_FD )
+ read -n 1 -u $PALUDIS_PIPE_COMMAND_READ_FD c
[[ "$c" == $'\0' ]] && break
response1="${response1}${c}"
done
@@ -40,7 +40,7 @@ done
echo "$2" | tr "\n" "\0" 1>&$PALUDIS_PIPE_COMMAND_WRITE_FD
response2=
while true ; do
- c=$(head -c1 <&$PALUDIS_PIPE_COMMAND_READ_FD )
+ read -n 1 -u $PALUDIS_PIPE_COMMAND_READ_FD c
[[ "$c" == $'\0' ]] && break
response2="${response2}${c}"
done
@@ -48,7 +48,7 @@ done
echo "$3" | tr "\n" "\0" 1>&$PALUDIS_PIPE_COMMAND_WRITE_FD
response3=
while true ; do
- c=$(head -c1 <&$PALUDIS_PIPE_COMMAND_READ_FD )
+ read -n 1 -u $PALUDIS_PIPE_COMMAND_READ_FD c
[[ "$c" == $'\0' ]] && break
response3="${response3}${c}"
done