[Libreoffice-commits] buildbot.git: lcov-report/lcov-report.sh

Maarten Hoes hoes.maarten at gmail.com
Mon Dec 15 05:50:38 PST 2014


 lcov-report/lcov-report.sh |   23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

New commits:
commit 1bd824172fb3ee780268f6f11f3ba441996e11a7
Author: Maarten Hoes <hoes.maarten at gmail.com>
Date:   Mon Dec 15 09:02:22 2014 +0100

    Be more intelligent with 'readlink -f' for paths that dont exist yet.
    
    Change-Id: I9575466e2705f9cbc75ab2a2a6a1209530556232
    Reviewed-on: https://gerrit.libreoffice.org/13475
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/lcov-report/lcov-report.sh b/lcov-report/lcov-report.sh
index 8a20a46..20cd233 100755
--- a/lcov-report/lcov-report.sh
+++ b/lcov-report/lcov-report.sh
@@ -28,17 +28,20 @@ init()
     fi
 
     if [ -n "${SRC_DIR?}" ] ; then
+        if [ "${SRC_DIR?}" = "${BUILD_DIR?}" ] ; then
+            die "Cannot set the source directory to the same value as the build directory."
+        fi
+
         if [ ! -d "${SRC_DIR?}" ] ; then
             die "Failed to locate source code directory $SRC_DIR."
+        else
+            SRC_DIR=$(readlink -f "${SRC_DIR?}")
         fi
 
         if [ ! -d "${SRC_DIR?}/.git" ] ; then
             die "${SRC_DIR?} is not a git repository."
         fi
 
-        if [ "${SRC_DIR?}" = "${BUILD_DIR?}" ] ; then
-            die "Cannot set the source directory to the same value as the build directory."
-        fi
     fi
 
     if [ "${AFTER?}" = "TRUE" ] ; then
@@ -60,9 +63,11 @@ init()
 
         if [ ! -d "${HTML_DIR?}" ] ; then
             mkdir "${HTML_DIR?}" || die "Failed to create html directory ${HTML_DIR?}."
+            HTML_DIR=$(readlink -f "${HTML_DIR?}")
         else
             rm -rf "${HTML_DIR?}"
             mkdir "${HTML_DIR?}" || die "Failed to create html directory ${HTML_DIR?}."
+            HTML_DIR=$(readlink -f "${HTML_DIR?}")
         fi
     fi
 
@@ -83,9 +88,11 @@ init()
     if [ "${BEFORE?}" = "TRUE" ] ; then
         if [ ! -d "${TRACEFILE_DIR?}" ] ; then
             mkdir "${TRACEFILE_DIR?}" || die "Failed to create tracefile directory ${TRACEFILE_DIR?}."
+            TRACEFILE_DIR=$(readlink -f "${TRACEFILE_DIR?}")
         else
             rm -rf "${TRACEFILE_DIR?}"
             mkdir "${TRACEFILE_DIR?}" || die "Failed to create tracefile directory ${TRACEFILE_DIR?}."
+            TRACEFILE_DIR=$(readlink -f "${TRACEFILE_DIR?}")
         fi
     fi
 
@@ -99,9 +106,11 @@ init()
         fi
         if [ ! -d "$BUILD_DIR" ] ; then
             mkdir "$BUILD_DIR" || die "Failed to create source compile directory $BUILD_DIR."
+            BUILD_DIR=$(readlink -f "${BUILD_DIR?}")
         else
             rm -rf "$BUILD_DIR"
             mkdir "$BUILD_DIR" || die "Failed to create source compile directory $BUILD_DIR."
+            BUILD_DIR=$(readlink -f "${BUILD_DIR?}")
         fi
     fi
 }
@@ -219,19 +228,19 @@ fi
 while getopts ":s:t:w:C:d:abc" opt ; do
     case "$opt" in
     s)
-        SRC_DIR=$(readlink -f "${OPTARG?}")
+        SRC_DIR="${OPTARG?}"
         ;;
     t)
-        TRACEFILE_DIR=$(readlink -f "${OPTARG?}")
+        TRACEFILE_DIR="${OPTARG?}"
         ;;
     w)
-        HTML_DIR=$(readlink -f "${OPTARG?}")
+        HTML_DIR="${OPTARG?}"
         ;;
     c)
         SOURCE_COMPILE=TRUE
         ;;
     C)
-        BUILD_DIR=$(readlink -f "${OPTARG?}")
+        BUILD_DIR="${OPTARG?}"
         ;;
     b)
         BEFORE=TRUE


More information about the Libreoffice-commits mailing list