summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaarten Hoes <hoes.maarten@gmail.com>2014-11-16 23:41:00 +0100
committerNorbert Thiebaud <nthiebaud@gmail.com>2014-11-16 23:01:59 +0000
commit01bcb90a73dc7f09b8fd8d10ca1fc061ffe4c16e (patch)
tree1c2278414228b33fe0e6c400448ac843c050f68c
parent2082cf5aacd8171b9d9369b2edcf7c40cc5fab31 (diff)
Dont 'rm TRACEFILE_DIR' when running '-a', some other minor fixes.
Change-Id: Ie03e3052b6cb675af463c1dab02d5ffb08935746 Reviewed-on: https://gerrit.libreoffice.org/12506 Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com> Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
-rwxr-xr-xlcov-report/lcov-report.sh17
1 files changed, 12 insertions, 5 deletions
diff --git a/lcov-report/lcov-report.sh b/lcov-report/lcov-report.sh
index 4d7046a..a490b3b 100755
--- a/lcov-report/lcov-report.sh
+++ b/lcov-report/lcov-report.sh
@@ -53,7 +53,7 @@ init()
if [ -z "${SRC_DIR?}" ] ; then
die "When specifying '-a', you also need to specify '-s'."
fi
- if [ -d "${HTML_DIR?}" ] ; then
+ if [ ! -d "${HTML_DIR?}" ] ; then
mkdir "${HTML_DIR?}" || die "Failed to create html directory ${HTML_DIR?}."
else
rm -rf "${HTML_DIR?}"
@@ -65,6 +65,9 @@ init()
if [ -z "${TRACEFILE_DIR?}" ] ; then
die "When specifying '-a' or '-b', you also need to specify '-t'."
fi
+ fi
+
+ if [ "${BEFORE?}" = "TRUE" ] ; then
if [ ! -d "${TRACEFILE_DIR?}" ] ; then
mkdir "${TRACEFILE_DIR?}" || die "Failed to create tracefile directory ${TRACEFILE_DIR?}."
else
@@ -73,6 +76,12 @@ init()
fi
fi
+ if [ "${AFTER?}" = "TRUE" ] ; then
+ if [ ! -d "${TRACEFILE_DIR?}" ] ; then
+ die "Failed to locate tracefile directory ${TRACEFILE_DIR?}."
+ fi
+ fi
+
if [ "${SOURCE_COMPILE?}" = "TRUE" ] ; then
if [ -z "${BUILD_DIR?}" ] ; then
die "When specifying '-c', you also need to specify '-C'."
@@ -136,7 +145,7 @@ lcov_tracefile_cleanup()
lcov_mkhtml()
{
- cd "$SRC_DIR"
+ cd "${SRC_DIR?}"
COMMIT_SHA1=$(git log --date=iso | head -3 | awk '/^commit/ {print $2}')
COMMIT_DATE=$(git log --date=iso | head -3 | awk '/^Date/ {print $2}')
@@ -173,7 +182,7 @@ AFTER=
SRC_DIR=
TRACEFILE_DIR=
HTML_DIR=
-BUIILD_DIR=
+BUILD_DIR=
if [ "$#" = "0" ] ; then
usage
@@ -208,8 +217,6 @@ while getopts ":s:t:w:C:abc" opt ; do
esac
done
-echo "foo"
-
init
if [ "${BEFORE?}" = "TRUE" ] ; then