All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [RFC PATCH v1 0/1] Include timezone information in build
@ 2015-04-30  0:38 Chris Packham
  2015-04-30  0:38 ` [U-Boot] [RFC PATCH v1] Makefile: Add U_BOOT_TZ and include in version Chris Packham
  2015-05-08 21:05 ` [U-Boot] [RFC PATCH v1 0/1] Include timezone information in build Tom Rini
  0 siblings, 2 replies; 8+ messages in thread
From: Chris Packham @ 2015-04-30  0:38 UTC (permalink / raw)
  To: u-boot

Hi,


Recently an eagle-eyed tester pointed out to me that the build time
reported in my u-boot build did not match the file timestamp on the
server it was stored on. This is because at $dayjob we have a build farm
with times set to UTC while the storage server was displaying the local
time. In reality the times were the same but the timezones were not and
there is no indication in the u-boot version about how to interpret the
time.

This is my attempt to address the issue by defining U_BOOT_TZ along side
U_BOOT_TIME and U_BOOT_DATE. I've kept the TZ portion separate because I
thought there might some push pack on changing the version string. For
my purposes I can display the TZ separately as long as it is defined by
the build process. I've also elected to use %Z instead of %z as I feel
that the timezone name is more friendly but that's just a personal
preference so I wouldn't object to switching to the numeric
representation if others feel strongly.


Chris Packham (1):
  Makefile: Add U_BOOT_TZ and include in version

 Makefile          | 3 ++-
 include/version.h | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

-- 
2.3.5

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [RFC PATCH v1] Makefile: Add U_BOOT_TZ and include in version
  2015-04-30  0:38 [U-Boot] [RFC PATCH v1 0/1] Include timezone information in build Chris Packham
@ 2015-04-30  0:38 ` Chris Packham
  2015-05-06  5:38   ` Chris Packham
  2015-05-10  9:02   ` [U-Boot] [PATCH v2] " Chris Packham
  2015-05-08 21:05 ` [U-Boot] [RFC PATCH v1 0/1] Include timezone information in build Tom Rini
  1 sibling, 2 replies; 8+ messages in thread
From: Chris Packham @ 2015-04-30  0:38 UTC (permalink / raw)
  To: u-boot

Define U_BOOT_TZ alongside U_BOOT_TIME and U_BOOT_DATE and use it to
include the timezone in the version output.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
---

 Makefile          | 3 ++-
 include/version.h | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 1e52008..c6b8d3f 100644
--- a/Makefile
+++ b/Makefile
@@ -1230,7 +1230,8 @@ endef
 
 define filechk_timestamp.h
 	(LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"'; \
-	LC_ALL=C date +'#define U_BOOT_TIME "%T"')
+	LC_ALL=C date +'#define U_BOOT_TIME "%T"'; \
+	LC_ALL=C date +'#define U_BOOT_TZ "%Z"')
 endef
 
 $(version_h): include/config/uboot.release FORCE
diff --git a/include/version.h b/include/version.h
index d6c7cf2..777e9f6 100644
--- a/include/version.h
+++ b/include/version.h
@@ -19,7 +19,7 @@
 #endif
 
 #define U_BOOT_VERSION_STRING U_BOOT_VERSION " (" U_BOOT_DATE " - " \
-	U_BOOT_TIME ")" CONFIG_IDENT_STRING
+	U_BOOT_TIME " " U_BOOT_TZ ")" CONFIG_IDENT_STRING
 
 #ifndef __ASSEMBLY__
 extern const char version_string[];
-- 
2.3.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [U-Boot] [RFC PATCH v1] Makefile: Add U_BOOT_TZ and include in version
  2015-04-30  0:38 ` [U-Boot] [RFC PATCH v1] Makefile: Add U_BOOT_TZ and include in version Chris Packham
@ 2015-05-06  5:38   ` Chris Packham
  2015-05-06 15:01     ` Simon Glass
  2015-05-10  9:02   ` [U-Boot] [PATCH v2] " Chris Packham
  1 sibling, 1 reply; 8+ messages in thread
From: Chris Packham @ 2015-05-06  5:38 UTC (permalink / raw)
  To: u-boot

Hi,

On Thu, Apr 30, 2015 at 12:38 PM, Chris Packham <judge.packham@gmail.com> wrote:
> Define U_BOOT_TZ alongside U_BOOT_TIME and U_BOOT_DATE and use it to
> include the timezone in the version output.
>
> Signed-off-by: Chris Packham <judge.packham@gmail.com>
> ---
>
>  Makefile          | 3 ++-
>  include/version.h | 2 +-
>  2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 1e52008..c6b8d3f 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1230,7 +1230,8 @@ endef
>
>  define filechk_timestamp.h
>         (LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"'; \
> -       LC_ALL=C date +'#define U_BOOT_TIME "%T"')
> +       LC_ALL=C date +'#define U_BOOT_TIME "%T"'; \
> +       LC_ALL=C date +'#define U_BOOT_TZ "%Z"')
>  endef
>
>  $(version_h): include/config/uboot.release FORCE
> diff --git a/include/version.h b/include/version.h
> index d6c7cf2..777e9f6 100644
> --- a/include/version.h
> +++ b/include/version.h
> @@ -19,7 +19,7 @@
>  #endif
>
>  #define U_BOOT_VERSION_STRING U_BOOT_VERSION " (" U_BOOT_DATE " - " \
> -       U_BOOT_TIME ")" CONFIG_IDENT_STRING
> +       U_BOOT_TIME " " U_BOOT_TZ ")" CONFIG_IDENT_STRING
>
>  #ifndef __ASSEMBLY__
>  extern const char version_string[];
> --
> 2.3.5
>

Any feedback? I see I've now missed the merge window (sending the
patch as RFC on the day before it closed didn't help, sorry about
that). But is the general idea OK for when I re-submit when the next
merge window opens?

Thanks,
Chris

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [RFC PATCH v1] Makefile: Add U_BOOT_TZ and include in version
  2015-05-06  5:38   ` Chris Packham
@ 2015-05-06 15:01     ` Simon Glass
  0 siblings, 0 replies; 8+ messages in thread
From: Simon Glass @ 2015-05-06 15:01 UTC (permalink / raw)
  To: u-boot

Hi Chris,

On 5 May 2015 at 23:38, Chris Packham <judge.packham@gmail.com> wrote:
> Hi,
>
> On Thu, Apr 30, 2015 at 12:38 PM, Chris Packham <judge.packham@gmail.com> wrote:
>> Define U_BOOT_TZ alongside U_BOOT_TIME and U_BOOT_DATE and use it to
>> include the timezone in the version output.
>>
>> Signed-off-by: Chris Packham <judge.packham@gmail.com>
>> ---
>>
>>  Makefile          | 3 ++-
>>  include/version.h | 2 +-
>>  2 files changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/Makefile b/Makefile
>> index 1e52008..c6b8d3f 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -1230,7 +1230,8 @@ endef
>>
>>  define filechk_timestamp.h
>>         (LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"'; \
>> -       LC_ALL=C date +'#define U_BOOT_TIME "%T"')
>> +       LC_ALL=C date +'#define U_BOOT_TIME "%T"'; \
>> +       LC_ALL=C date +'#define U_BOOT_TZ "%Z"')
>>  endef
>>
>>  $(version_h): include/config/uboot.release FORCE
>> diff --git a/include/version.h b/include/version.h
>> index d6c7cf2..777e9f6 100644
>> --- a/include/version.h
>> +++ b/include/version.h
>> @@ -19,7 +19,7 @@
>>  #endif
>>
>>  #define U_BOOT_VERSION_STRING U_BOOT_VERSION " (" U_BOOT_DATE " - " \
>> -       U_BOOT_TIME ")" CONFIG_IDENT_STRING
>> +       U_BOOT_TIME " " U_BOOT_TZ ")" CONFIG_IDENT_STRING
>>
>>  #ifndef __ASSEMBLY__
>>  extern const char version_string[];
>> --
>> 2.3.5
>>
>
> Any feedback? I see I've now missed the merge window (sending the
> patch as RFC on the day before it closed didn't help, sorry about
> that). But is the general idea OK for when I re-submit when the next
> merge window opens?

Seems like a reasonable idea to me.

Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

Regards,
Simon

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [RFC PATCH v1 0/1] Include timezone information in build
  2015-04-30  0:38 [U-Boot] [RFC PATCH v1 0/1] Include timezone information in build Chris Packham
  2015-04-30  0:38 ` [U-Boot] [RFC PATCH v1] Makefile: Add U_BOOT_TZ and include in version Chris Packham
@ 2015-05-08 21:05 ` Tom Rini
  2015-05-10  9:28   ` Chris Packham
  1 sibling, 1 reply; 8+ messages in thread
From: Tom Rini @ 2015-05-08 21:05 UTC (permalink / raw)
  To: u-boot

On Thu, Apr 30, 2015 at 12:38:22PM +1200, Chris Packham wrote:
> Hi,
> 
> 
> Recently an eagle-eyed tester pointed out to me that the build time
> reported in my u-boot build did not match the file timestamp on the
> server it was stored on. This is because at $dayjob we have a build farm
> with times set to UTC while the storage server was displaying the local
> time. In reality the times were the same but the timezones were not and
> there is no indication in the u-boot version about how to interpret the
> time.
> 
> This is my attempt to address the issue by defining U_BOOT_TZ along side
> U_BOOT_TIME and U_BOOT_DATE. I've kept the TZ portion separate because I
> thought there might some push pack on changing the version string. For
> my purposes I can display the TZ separately as long as it is defined by
> the build process. I've also elected to use %Z instead of %z as I feel
> that the timezone name is more friendly but that's just a personal
> preference so I wouldn't object to switching to the numeric
> representation if others feel strongly.

Concept is fine, I'd actually prefer %z so that the size increase is
constant at least.  Please do that in a non-RFC v2 and I'll pick it up,
thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150508/b8c86d16/attachment.sig>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH v2] Makefile: Add U_BOOT_TZ and include in version
  2015-04-30  0:38 ` [U-Boot] [RFC PATCH v1] Makefile: Add U_BOOT_TZ and include in version Chris Packham
  2015-05-06  5:38   ` Chris Packham
@ 2015-05-10  9:02   ` Chris Packham
  2015-05-28 13:23     ` [U-Boot] [U-Boot, " Tom Rini
  1 sibling, 1 reply; 8+ messages in thread
From: Chris Packham @ 2015-05-10  9:02 UTC (permalink / raw)
  To: u-boot

Define U_BOOT_TZ alongside U_BOOT_TIME and U_BOOT_DATE and use it to
include the timezone in the version output.

Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Chris Packham <judge.packham@gmail.com>
---
As per feedback from Tom I've switched to '%z' so that any size increase
as a result of the timezone information is constant.

Changes in v2:
- Switched to '%z'
- Rebased against 2017.07-rc1

 Makefile          | 3 ++-
 include/version.h | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 24503ac..1f488aa 100644
--- a/Makefile
+++ b/Makefile
@@ -1230,7 +1230,8 @@ endef
 
 define filechk_timestamp.h
 	(LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"'; \
-	LC_ALL=C date +'#define U_BOOT_TIME "%T"')
+	LC_ALL=C date +'#define U_BOOT_TIME "%T"'; \
+	LC_ALL=C date +'#define U_BOOT_TZ "%z"')
 endef
 
 $(version_h): include/config/uboot.release FORCE
diff --git a/include/version.h b/include/version.h
index d6c7cf2..777e9f6 100644
--- a/include/version.h
+++ b/include/version.h
@@ -19,7 +19,7 @@
 #endif
 
 #define U_BOOT_VERSION_STRING U_BOOT_VERSION " (" U_BOOT_DATE " - " \
-	U_BOOT_TIME ")" CONFIG_IDENT_STRING
+	U_BOOT_TIME " " U_BOOT_TZ ")" CONFIG_IDENT_STRING
 
 #ifndef __ASSEMBLY__
 extern const char version_string[];
-- 
2.3.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [U-Boot] [RFC PATCH v1 0/1] Include timezone information in build
  2015-05-08 21:05 ` [U-Boot] [RFC PATCH v1 0/1] Include timezone information in build Tom Rini
@ 2015-05-10  9:28   ` Chris Packham
  0 siblings, 0 replies; 8+ messages in thread
From: Chris Packham @ 2015-05-10  9:28 UTC (permalink / raw)
  To: u-boot

Hi Tom,

On Sat, May 9, 2015 at 9:05 AM, Tom Rini <trini@konsulko.com> wrote:
> On Thu, Apr 30, 2015 at 12:38:22PM +1200, Chris Packham wrote:
>> Hi,
>>
>>
>> Recently an eagle-eyed tester pointed out to me that the build time
>> reported in my u-boot build did not match the file timestamp on the
>> server it was stored on. This is because at $dayjob we have a build farm
>> with times set to UTC while the storage server was displaying the local
>> time. In reality the times were the same but the timezones were not and
>> there is no indication in the u-boot version about how to interpret the
>> time.
>>
>> This is my attempt to address the issue by defining U_BOOT_TZ along side
>> U_BOOT_TIME and U_BOOT_DATE. I've kept the TZ portion separate because I
>> thought there might some push pack on changing the version string. For
>> my purposes I can display the TZ separately as long as it is defined by
>> the build process. I've also elected to use %Z instead of %z as I feel
>> that the timezone name is more friendly but that's just a personal
>> preference so I wouldn't object to switching to the numeric
>> representation if others feel strongly.
>
> Concept is fine, I'd actually prefer %z so that the size increase is
> constant at least.  Please do that in a non-RFC v2 and I'll pick it up,
> thanks!

v2 has been sent. After I sent it out of curiosity, I looked up the
POSIX definition of date[1] and it looks as though '%z' is not part of
the spec ('%Z' is). However '%z' is part of the POSIX definition of
strfttime[2]. In practice I'm not sure how much it matters. I know the
GNU date command supports it and it looks like the freebsd one also
does.

I'm not sure which other environments people are using to build
u-boot, hopefully any other environments pass the format string to
strftime(). Just thought I'd bring it up in case someone reports an
issue down the line.

Thanks,
Chris
--
[1] - http://pubs.opengroup.org/onlinepubs/9699919799/utilities/date.html
[2] - http://pubs.opengroup.org/onlinepubs/9699919799/functions/strftime.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [U-Boot, v2] Makefile: Add U_BOOT_TZ and include in version
  2015-05-10  9:02   ` [U-Boot] [PATCH v2] " Chris Packham
@ 2015-05-28 13:23     ` Tom Rini
  0 siblings, 0 replies; 8+ messages in thread
From: Tom Rini @ 2015-05-28 13:23 UTC (permalink / raw)
  To: u-boot

On Sun, May 10, 2015 at 09:02:09PM +1200, Chris Packham wrote:

> Define U_BOOT_TZ alongside U_BOOT_TIME and U_BOOT_DATE and use it to
> include the timezone in the version output.
> 
> Acked-by: Simon Glass <sjg@chromium.org>
> Signed-off-by: Chris Packham <judge.packham@gmail.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150528/4147a183/attachment.sig>

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-05-28 13:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-30  0:38 [U-Boot] [RFC PATCH v1 0/1] Include timezone information in build Chris Packham
2015-04-30  0:38 ` [U-Boot] [RFC PATCH v1] Makefile: Add U_BOOT_TZ and include in version Chris Packham
2015-05-06  5:38   ` Chris Packham
2015-05-06 15:01     ` Simon Glass
2015-05-10  9:02   ` [U-Boot] [PATCH v2] " Chris Packham
2015-05-28 13:23     ` [U-Boot] [U-Boot, " Tom Rini
2015-05-08 21:05 ` [U-Boot] [RFC PATCH v1 0/1] Include timezone information in build Tom Rini
2015-05-10  9:28   ` Chris Packham

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.