You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ch...@apache.org on 2012/08/22 21:35:38 UTC
git commit: Patch from Greg Burd: Improve portability of the
build-apidoc.sh script by replacing readlink
Updated Branches:
refs/heads/master 3ada5e4a4 -> e0f505e36
Patch from Greg Burd: Improve portability of the build-apidoc.sh script by replacing readlink
Review: https://reviews.apache.org/r/6733/
Testing: Applied patch, and ran 'ant clean-all build-apidocs'
on both OSX and Ubuntu 12. Initial testing confirmed the issue
that Greg discovered on OSX. After the patch, the docs built
correctly.
Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/e0f505e3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/e0f505e3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/e0f505e3
Branch: refs/heads/master
Commit: e0f505e36f0074607c673f88ce416062e434ca07
Parents: 3ada5e4
Author: Chip Childers <ch...@gmail.com>
Authored: Wed Aug 22 15:33:17 2012 -0400
Committer: Chip Childers <ch...@gmail.com>
Committed: Wed Aug 22 15:33:17 2012 -0400
----------------------------------------------------------------------
setup/apidoc/build-apidoc.sh | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e0f505e3/setup/apidoc/build-apidoc.sh
----------------------------------------------------------------------
diff --git a/setup/apidoc/build-apidoc.sh b/setup/apidoc/build-apidoc.sh
index 618273f..14d6459 100644
--- a/setup/apidoc/build-apidoc.sh
+++ b/setup/apidoc/build-apidoc.sh
@@ -27,8 +27,18 @@ shift
DISTDIR="$1"
shift
-thisdir=$(readlink -f $(dirname "$0"))
+canonical_readlink ()
+{
+ cd `dirname $1`;
+ __filename=`basename $1`;
+ if [ -h "$__filename" ]; then
+ canonical_readlink `readlink $__filename`;
+ else
+ echo "`pwd -P`";
+ fi
+}
+thisdir=$(canonical_readlink $0)
PATHSEP=':'
if [[ $OSTYPE == "cygwin" ]] ; then
@@ -50,7 +60,7 @@ java -cp $CP com.cloud.api.doc.ApiXmlDocWriter -d "$DISTDIR" $*
if [ $? -ne 0 ]
then
- exit 1
+ exit 1
fi
set -e
@@ -61,7 +71,7 @@ set -e
sed -e 's,%API_HEADER%,Root Admin API,g' "$thisdir/generatetoc_header.xsl" >generatetocforadmin.xsl
sed -e 's,%API_HEADER%,Domain Admin API,g' "$thisdir/generatetoc_header.xsl" >generatetocfordomainadmin.xsl
- python "$thisdir/gen_toc.py" $(find -type f)
+ python "$thisdir/gen_toc.py" $(find . -type f)
cat generatetocforuser_include.xsl >>generatetocforuser.xsl
cat generatetocforadmin_include.xsl >>generatetocforadmin.xsl