summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2013-01-18 04:09:00 -0600
committerNorbert Thiebaud <nthiebaud@gmail.com>2013-01-18 19:39:29 -0600
commit884c6fecbaa6ded25c5994e4ecac2e11c1ca627c (patch)
treec7b60a2e613173fe9a001c9dcea21647a4caba72
parent879596443b58dce0ab18b051745d6b5428c031e4 (diff)
tb: missing Darwin specific parts, and 'timeout' support
-rw-r--r--tb/tb_internals.sh2
-rw-r--r--tb/tb_internals_Darwin.sh37
2 files changed, 38 insertions, 1 deletions
diff --git a/tb/tb_internals.sh b/tb/tb_internals.sh
index 068d4d5..6e8aed9 100644
--- a/tb/tb_internals.sh
+++ b/tb/tb_internals.sh
@@ -314,7 +314,7 @@ check_for_commit()
pushd "${TB_GIT_DIR?}" > /dev/null || die "Cannot cd to git repo ${TB_GIT_DIR?} for tb-branche ${b?}"
- err_msgs="$( $timeout git fetch 2>&1)"
+ err_msgs="$( $tb_TIMEOUT git fetch 2>&1)"
if [ "$?" -ne "0" ] ; then
printf "Git repo broken - error is:\n\n$err_msgs" > error_log.log
report_error owner "$(print_date)" error_log.log
diff --git a/tb/tb_internals_Darwin.sh b/tb/tb_internals_Darwin.sh
new file mode 100644
index 0000000..64cb469
--- /dev/null
+++ b/tb/tb_internals_Darwin.sh
@@ -0,0 +1,37 @@
+#!/usr/bin/env bash
+#
+#
+# Copyright (C) 2011-2013 Norbert Thiebaud
+# License: GPLv3+
+#
+# Mac specific override
+#
+
+# Do we have timeout? If yes, guard git pull with that - which has a
+# tendency to hang forever, when connection is flaky
+if which gtimeout > /dev/null 2>&1 ; then
+ # MacPorts/self-built - timeout is two hours
+ tb_TIMEOUT="$(which gtimeout) 2h"
+fi
+
+epoch_from_utc()
+{
+ date -juf '%Y-%m-%d %H:%M:%S' "$1 $2" '+%s'
+}
+
+epoch_to_utc()
+{
+ date -juf '%s' $1
+}
+
+print_date()
+{
+ date -u '+%Y-%m-%d %H:%M:%S'
+}
+
+deliver_lo_to_bibisect()
+{
+ rm -fr ${ARTIFACTDIR?}/opt
+ mkdir ${ARTIFACTDIR?}/opt
+ cp -fR ${optdir}/LibreOffice.app ${ARTIFACTDIR?}/opt/
+}