]> git.saurik.com Git - wxWidgets.git/commitdiff
Deal correctly with wx directory being a symlink in docs generation script.
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 1 Nov 2012 17:14:54 +0000 (17:14 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 1 Nov 2012 17:14:54 +0000 (17:14 +0000)
The script calling Doxygen is smart enough to strip the path of the wxWidgets
directory from the paths of the files, but it didn't do it correctly if this
directory was a symlink.

Fix this by using readlink, if available, to get the canonical name.

Closes #14796.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72839 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/doxygen/regen.sh

index 64daea529b0d11aa44ba0c968ccd0bb0b2e102a4..5e2757a57a0fbdc65f976ae6b9a8620992b403e9 100755 (executable)
@@ -20,11 +20,19 @@ me=$(basename $0)
 path=${0%%/$me}        # path from which the script has been launched
 current=$(pwd)
 cd $path
-if [ "$WXWIDGETS" = "" ]; then
-    export WXWIDGETS=`cd ../.. && pwd`
+if [[ -z "$WXWIDGETS" ]]; then
+    WXWIDGETS=`cd ../.. && pwd`
+    # Use the real path in case it's a symlink
+    if command -v readlink; then
+        normalized=`readlink -e $WXWIDGETS`
+        if [[ -n $normalized ]]; then
+            WXWIDGETS=$normalized
+        fi
+    fi 
     if [ "$OSTYPE" = "cygwin" ]; then
-        export WXWIDGETS=`cygpath -w $WXWIDGETS`
+        WXWIDGETS=`cygpath -w $WXWIDGETS`
     fi
+    export WXWIDGETS
 fi
 
 if [ "$DOXYGEN" = "" ]; then