maintainer: am-ft: add option to cater to clock skews
authorStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 23 Dec 2013 17:12:20 +0000 (18:12 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 23 Dec 2013 17:12:20 +0000 (18:12 +0100)
* maintainer/am-ft: Add option '-S', giving a number of seconds to sleep
after copying the tarball to the remote system and before unpacking,
building and testing it.  This is to cater to situations where the clock
of the remote system is skewed (in the past) w.r.t. the clock the local
system the tarball has been built on.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
maintainer/am-ft

index bb07c165c5f588d996b288176f71baae8c92112a..81a1dc5e241328be46ebf40192014dee21548740 100755 (executable)
@@ -35,10 +35,14 @@ cmd='
 
 remote=
 interactive=1
+maybe_sleep=:
 while test $# -gt 0; do
   case $1 in
    -b|--batch) interactive=0;;
    -c|--command) cmd=${2-}; shift;;
+    # Useful to avoid spurious errors due to skewed clocks between
+    # the system where the tarball is built and the target system.
+   -S|--sleep) maybe_sleep="sleep ${2-}"; shift;;
    -*) fatal "'$1': invalid option";;
     *) remote=$1; shift; break;;
   esac
@@ -92,6 +96,8 @@ set -x
 
 scp $tarball $remote:tmp/
 
+$maybe_sleep
+
 # Multiple '-t' to force tty allocation.
 ssh -t -t $remote "
   set -x; set -e; set -u;