diff options
author | Felix Fietkau <nbd@openwrt.org> | 2016-01-31 23:28:55 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2016-01-31 23:28:55 +0000 |
commit | c07b5ec4fc3e4d61775cfc2ed473a00e2752fe4a (patch) | |
tree | 10eb56d2591d0b987fb75336b18c29c249eed257 /scripts | |
parent | f0ccd05a9f156e87f2be2acdd2b77e9d697053db (diff) | |
download | master-187ad058-c07b5ec4fc3e4d61775cfc2ed473a00e2752fe4a.tar.gz master-187ad058-c07b5ec4fc3e4d61775cfc2ed473a00e2752fe4a.tar.bz2 master-187ad058-c07b5ec4fc3e4d61775cfc2ed473a00e2752fe4a.zip |
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 <lynxis@fe80.eu>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@48583 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/portable_date.sh | 11 |
1 files changed, 11 insertions, 0 deletions
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 $? |