hooks: take advantage of strftime's %N format
commit8d191ed42558ae6099e54deb220bc1d9377f9fc8
authorKyle J. McKay <mackyle@gmail.com>
Mon, 25 Dec 2017 16:06:34 +0000 (25 08:06 -0800)
committerKyle J. McKay <mackyle@gmail.com>
Mon, 25 Dec 2017 16:06:34 +0000 (25 08:06 -0800)
treec9c53d20daafeb45c6ac5d78ec29fad7b243a9bc
parent1f19e74d21b4b511090794458ae4cd0094ed98f2
hooks: take advantage of strftime's %N format

By using our own strftime utility instead of the date utility we
can take advantage of the %N format (nanoseconds) and even though
it only has microsecond granularity, that's far superior to the
single second granularity of the date command.

Additionally it provides the "extra semantics" of doing a usleep(1)
both before and after the call to gettimeofday when using the %N
specifier.

Replace the two "sleep 1" calls and the single "date" call with a
"strftime" call using %N and adjust the surrounding code to massage
that output into a unique name using microseconds while still
providing the HHMMSS value needed for writing into the log.

This does require that strftime be installed into the chroot jail now.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
hooks/pre-receive
jailsetup.sh