From 2f14514a12f708fecbe786e028fb9e3c542907da Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 31 Jan 2016 23:28:55 +0000 Subject: 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 SVN-Revision: 48583 --- scripts/portable_date.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 scripts/portable_date.sh (limited to 'scripts/portable_date.sh') diff --git a/scripts/portable_date.sh b/scripts/portable_date.sh new file mode 100755 index 0000000000..84a18eb621 --- /dev/null +++ b/scripts/portable_date.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +case $(uname) in + NetBSD|OpenBSD|DragonFly|FreeBSD|Darwin) + date -r $1 $2 + ;; + *) + date -d @$1 $2 +esac + +exit $? -- cgit v1.2.3