[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2 1/8] xen: calculate XEN_BUILD_TIME using XEN_BUILD_DATE value



On Wed, Jul 04, 2018 at 02:58:17PM +0100, Ian Jackson wrote:
> Daniel Kiper writes ("Re: [PATCH v2 1/8] xen: calculate XEN_BUILD_TIME using 
> XEN_BUILD_DATE value"):
> > Well, this complicates situation further and it seems to me that
> > sed-ery cannot be sufficient. Anyway, I will take a look how to
> > solve that.
>
> Our other current host OS is FreeBSD.  FreeBSD's date(1) uses -d for
> something utterly different (also, something mad).  Can we rely on
> Perl yet ?  Perl can do this kind of thing easily enough.

Oh, Perl, it seems like a dying language... Sniff...

> Alternatively we could have a wrapper script.

I think that it is a better solution.

> Andrew Cooper:
> > Why are we adding yet more Xen specific logic to implement the same as
> > SOURCE_DATE_EPOCH from the reproducible-builds.org effort?
>
> We should clearly honour SOURCE_DATE_EPOCH.  But that's a different
> question.
>
> I think the right thing is something like this:
>
> export XEN_BUILD_POSIX_TIME   ?= $(shell echo $${SOURCE_DATE_EPOCH-date +%s})

OK, but what if SOURCE_DATE_EPOCH is not defined?
"date" command is not a good solution here.

> export XEN_BUILD_DATE         ?= $(shell LC_ALL=C date_parsing_epoch 
> $(XEN_BUILD_EPOCH))
> export XEN_BUILD_TIME         ?= $(shell LC_ALL=C date_parsing_epoch 
> $(XEN_BUILD_EPOCH) +%T)
>
> Where date_parsing_epoch is this on GNU systems
>
>    #!/bin/sh
>    set -e
>    epoch=$1; shift
>    date -u -d "@$epoch" "$@"
>
> and I think something like this on FreeBSD
>
>    #!/bin/sh
>    set -e
>    epoch=$1; shift
>    date -u -jn -f%s "$epoch" "$@"

If other guys are OK with that I can prepare a patch with your Suggested-by.

Daniel

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.