fakedate: simplify logic
authorPeter Korsgaard <peter@korsgaard.com>
Tue, 7 Feb 2017 22:08:17 +0000 (23:08 +0100)
committerPeter Korsgaard <peter@korsgaard.com>
Mon, 3 Jul 2017 13:10:58 +0000 (15:10 +0200)
commite7548edb5f930362e361b14eb67cda2b16c8846c
tree7a7ef4ae68202811026a289b1df1fe3da48755fd
parent51825df3a184cad0f5bccb6a18b9d6197855cab6
fakedate: simplify logic

Using -ef to check for the same file is nicer than relying on a magic
symlink-to-fakedate.

Notice that -ef isn't stricly posix (but supported by bash/dash/zsh), so
I've changed the shebang to /bin/bash.

While we are at it, restructure the logic to do a single exec at the end
instead of handling the epoch/!epoch cases differently for simplicity.

With that out of the way we can directly install it as $HOST/usr/bin/date
instead of the fakedate / date symlink.

[Peter: drop IFS=: change]
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/fakedate/fakedate
package/fakedate/fakedate.mk