2003-11-19 18:17:56 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
2006-04-15 04:27:44 +02:00
|
|
|
# Make sure the host sed supports '-i' (in-place).
|
|
|
|
# If it doesn't, we'll build and use our own.
|
|
|
|
|
|
|
|
if test -x /usr/bin/sed ; then
|
|
|
|
SED="/usr/bin/sed"
|
2003-11-19 18:17:56 +01:00
|
|
|
else
|
2006-04-15 04:27:44 +02:00
|
|
|
if test -x /bin/sed ; then
|
|
|
|
SED="/bin/sed"
|
|
|
|
else
|
|
|
|
SED="sed"
|
|
|
|
fi
|
|
|
|
fi
|
2003-11-19 18:17:56 +01:00
|
|
|
|
|
|
|
echo "HELLO" > .sedtest
|
|
|
|
$SED -i -e "s/HELLO/GOODBYE/" .sedtest >/dev/null 2>&1
|
|
|
|
|
2006-04-15 04:27:44 +02:00
|
|
|
if test $? != 0 ; then
|
2003-11-19 18:17:56 +01:00
|
|
|
echo build-sed-host-binary
|
2003-11-24 16:55:50 +01:00
|
|
|
else
|
|
|
|
echo use-sed-host-binary
|
2006-04-15 04:27:44 +02:00
|
|
|
fi
|
2003-11-19 18:17:56 +01:00
|
|
|
|
2006-04-15 04:27:44 +02:00
|
|
|
rm -f .sedtest
|