# HG changeset patch # User "Yann E. MORIN" # Date 1302213764 -7200 # Node ID bb6e2df2427f3db871721c96ca3226cfa24204bc # Parent cbd07f3dd6e3689a6b971e999aa82d09fb94d515 functions: fix date calculations In case date(1) does not support nanosecond resolution, it does not interpret '%N', and leave it as-is. So we have to remove it. Note that some versions replaces '%N' with 'N', so we have to take this into account as well. Reported-by: Kyle Grieb Signed-off-by: "Yann E. MORIN" diff -r cbd07f3dd6e3 -r bb6e2df2427f scripts/functions --- a/scripts/functions Thu Apr 07 11:52:23 2011 +0200 +++ b/scripts/functions Fri Apr 08 00:02:44 2011 +0200 @@ -250,7 +250,7 @@ # to the highest entire second # Usage: CT_DoDate CT_DoDate() { - date "$1" |sed -r -e 's/N$/000000000/;' + date "$1" |sed -r -e 's/%?N$/000000000/;' } CT_STEP_COUNT=1