common/wrappers: add date and uname wrappers.

uname:
  overwrites the hostname in command uname with the string 'void'.
date:
  uses the timestamp read from SOURCE_DATE_EPOCH as date.
This commit is contained in:
Enno Boland 2016-03-03 11:31:57 +01:00
parent 8c2840b174
commit 5a2a63645f
2 changed files with 11 additions and 0 deletions

6
common/wrappers/date.sh Normal file
View file

@ -0,0 +1,6 @@
#!/bin/sh
if [ "$SOURCE_DATE_EPOCH" ]; then
post="--date @$SOURCE_DATE_EPOCH"
fi
exec /usr/bin/date $@ $post

5
common/wrappers/uname.sh Normal file
View file

@ -0,0 +1,5 @@
#!/bin/sh
uname=$(/usr/bin/uname $@)
rv=$?
echo "$uname" | sed "s/\(^\| \)$(/usr/bin/uname -n)\($\| \)/\1void\2/"