use alternate download url
[buildroot.git] / toolchain / dependencies / check-host-sed.sh
blob71f0eb9e8cba2c13637f3752ff5e9cba309fa2d5
1 SEDLIST="/usr/bin/sed /bin/sed sed gnused gsed"
3 for SED in $SEDLIST
4 do
5 if ! test -x $SED ; then
6 SED=$(which $SED 2> /dev/null)
7 if ! test -x "$SED" > /dev/null ; then
8 SED=""
9 continue
13 echo "HELLO" > .sedtest
14 $SED -i -e "s/HELLO/GOODBYE/" .sedtest >/dev/null 2>&1
15 RESULT=$(cat .sedtest)
17 if test $? != 0 ; then
18 SED=""
19 elif test -e ".sedtest-e" ; then
20 rm -f ".sedtest-e"
21 SED=""
22 elif [ "x$RESULT" = "x" ] || [ "$RESULT" != "GOODBYE" ] > /dev/null ;
23 then
24 SED=""
27 rm -f .sedtest
28 if [ ! -z "$SED" ] ; then
29 break
31 done
32 echo $SED