[CentOS-devel] RPM date strangeness (was:[CentOS] rpmbuild date shift)

Jeff Johnson n3npq at mac.com
Tue May 19 14:15:24 UTC 2009


On May 19, 2009, at 9:53 AM, Ralph Angenendt wrote:

> Jeff Johnson wrote:
>>
> Meaning: If my mock runs in EDT (as it seemingly does for me), finds  
> out
> that it is at 7:29 am, it then shifts to UTC (4 hours ahead), making  
> it
> 11:29 am then. This still is Tue May 19 2009 in this case. Am I  
> correct
> with that assumption?
>

You can test the above by changing timezones and displaying
the changelogtime as integer seconds, not (as --changelog does)
converting back to a displayformat.

     rpm -qp --qf '[%{changelogtime}\n]' foo*.src.rpm
vs
     ...............%{changelogtime:day}.............
is the essential difference between what is in the
RPMTAG_CHANGELOGTIME int32 array (i.e. seconds since 1/1/1970)
and what is displayed.

>
>> So in essence, the spec file is parsed wrto one local time zone, and
>> -- changelog is displayed wrto another local time zone, and what's in
>> the header is  in UTC (assuming the build system was configured
>> correctly and the spec file  was written in local time).
>
> This is what I don't get. I'm UTC +0200 - why do I get a shift of date
> to the next day in there, essentially leaving me on May 20th? Why  
> don't
> I get that when I'm on BST (UTC +0100)?
>

I can't tell precisely without a reproducer. Does one get an
extra hour of life in the spring or the fall? All depends on
reference points of comparison, not the time itself. There
are similar reference points implicit in parsing times from
%changelog entries and attempting to convert to UTC.

>>
>> But rpm *will* get the day of week correct even if its incorrectly
>> entered into the spec file %changelog.
>
> I still don't get that. Care to expand on it? I still assume that I
> entered the weekday correctly :)
>

I was trying to illustrate the "reference point" problem using day of  
week,
albeit obscurely.

Edit a spec file, change the day of week in some entry.

Build.

Use rpm -qp --changelog foo*.rpm.

The day of the week will be corrected in the displayed output.

The point is that WYSIWYG can/will mislead you when there are  
conversions involved.

73 de Jeff



More information about the CentOS-devel mailing list