You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ro...@apache.org on 2020/08/10 07:42:08 UTC
[cloudstack] branch 4.14 updated: build: Fix sed command failure in
Mac OS. (#4253)
This is an automated email from the ASF dual-hosted git repository.
rohit pushed a commit to branch 4.14
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/4.14 by this push:
new ce7a32c build: Fix sed command failure in Mac OS. (#4253)
ce7a32c is described below
commit ce7a32c51dd5b4905cd6b168ced3055c47f6973e
Author: Sina Kashipazha <so...@users.noreply.github.com>
AuthorDate: Mon Aug 10 09:41:45 2020 +0200
build: Fix sed command failure in Mac OS. (#4253)
apidoc build failed in Mac OS because of sed in-place command. It is a minor change that fixed this issue. More information here
Fixes: #3247
Fixes: #3312
---
tools/apidoc/build-apidoc.sh | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/tools/apidoc/build-apidoc.sh b/tools/apidoc/build-apidoc.sh
index 1b0f4f3..325452b 100755
--- a/tools/apidoc/build-apidoc.sh
+++ b/tools/apidoc/build-apidoc.sh
@@ -56,13 +56,23 @@ then
exit 1
fi
+# Default case for Linux sed, just use "-i"
+sedi='-i'
+case "$(uname)" in
+ # For macOS, use two parameters
+ Darwin*) sedi='-i ""'
+esac
+
+# Expand the parameters in the actual call to "sed"
+sed -e 's/foo/bar/' target.file
+
set -e
(cd "$DISTDIR/xmldoc"
cp "$thisdir"/*.java .
cp "$thisdir"/*.xsl .
sed -e 's,%API_HEADER%,All APIs,g' "$thisdir/generatetoc_header.xsl" >generatetoc.xsl
- sed -i "s/%ACS_RELEASE%/${ACS_RELEASE}/g" generatetoc.xsl
- sed -i "s/%ACS_RELEASE%/${ACS_RELEASE}/g" generatecommands.xsl
+ sed $sedi "s/%ACS_RELEASE%/${ACS_RELEASE}/g" generatetoc.xsl
+ sed $sedi "s/%ACS_RELEASE%/${ACS_RELEASE}/g" generatecommands.xsl
PLATFORM=`uname -s`
if [[ "$PLATFORM" =~ .*WIN.* ]]