From d72b93e58b0ccad4683d50543624d90dab761249 Mon Sep 17 00:00:00 2001 From: winlin Date: Thu, 3 Mar 2016 10:57:26 +0800 Subject: [PATCH] fix the sed bug, to compatible with osx --- trunk/auto/depends.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) mode change 100644 => 100755 trunk/auto/depends.sh diff --git a/trunk/auto/depends.sh b/trunk/auto/depends.sh old mode 100644 new mode 100755 index 94f0798d7..7dbdd01fd --- a/trunk/auto/depends.sh +++ b/trunk/auto/depends.sh @@ -362,7 +362,23 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then fi # the sed command -SED="sed -i" && if [ $OS_IS_OSX = YES ]; then SED="sed -i ''"; fi +function sed_utility() { + if [ $OS_IS_OSX = YES ]; then + sed -i '' "$@" + else + sed -i "$@" + fi + + ret=$?; if [[ $ret -ne 0 ]]; then + if [ $OS_IS_OSX = YES ]; then + echo "sed -i '' \"$@\"" + else + echo "sed -i \"$@\"" + fi + return $ret + fi +} +SED="sed_utility" && echo "SED is $SED" ##################################################################################### # check the os.