Author: nbd
Date: 2016-02-01 00:28:55 +0100 (Mon, 01 Feb 2016)
New Revision: 48583

Added:
   trunk/scripts/portable_date.sh
Log:
add scripts/portable_date: wrapper around date for bsd/linux

date -r $unix_timestamp on bsd is equal to date -d @$unix_timestamp on
linux. To support reproducible builds and not loosing every timestamp
it's required to convert a unix timestamp into human readable timestamp

./scripts/portable_date $unix_timstamp +%T

Signed-off-by: Alexander Couzens <[email protected]>

Added: trunk/scripts/portable_date.sh
===================================================================
--- trunk/scripts/portable_date.sh                              (rev 0)
+++ trunk/scripts/portable_date.sh      2016-01-31 23:28:55 UTC (rev 48583)
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+case $(uname) in
+       NetBSD|OpenBSD|DragonFly|FreeBSD|Darwin)
+               date -r $1 $2
+               ;;
+       *)
+               date -d @$1 $2
+esac
+
+exit $?


Property changes on: trunk/scripts/portable_date.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
_______________________________________________
openwrt-commits mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-commits

Reply via email to