Return-Path: X-Original-To: apmail-incubator-cloudstack-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-cloudstack-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CFFF4D2D4 for ; Wed, 22 Aug 2012 19:35:38 +0000 (UTC) Received: (qmail 40446 invoked by uid 500); 22 Aug 2012 19:35:38 -0000 Delivered-To: apmail-incubator-cloudstack-commits-archive@incubator.apache.org Received: (qmail 40422 invoked by uid 500); 22 Aug 2012 19:35:38 -0000 Mailing-List: contact cloudstack-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cloudstack-dev@incubator.apache.org Delivered-To: mailing list cloudstack-commits@incubator.apache.org Received: (qmail 40414 invoked by uid 99); 22 Aug 2012 19:35:38 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Aug 2012 19:35:38 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 5B5051EF9C; Wed, 22 Aug 2012 19:35:38 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: chipchilders@apache.org To: cloudstack-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: git commit: Patch from Greg Burd: Improve portability of the build-apidoc.sh script by replacing readlink Message-Id: <20120822193538.5B5051EF9C@tyr.zones.apache.org> Date: Wed, 22 Aug 2012 19:35:38 +0000 (UTC) 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 Authored: Wed Aug 22 15:33:17 2012 -0400 Committer: Chip Childers 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