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

Tue May 19 11:29:47 UTC 2009
Ralph Angenendt <ra+centos at br-online.de>

David Hrbáč wrote:
> Ralph Angenendt napsal(a):
> > Yes, I'm seeing that too:
> > 
> > Even if that is changed to UTC, it still is May 13th (and it doesn't explain
> > why subsequent changelog entries are one day off, too.
> 
> Thanks Ralph. Yes, it has nothing to do with time zone. 

It has. I don't know why, yet.

> I'm not sure if
> I've seen it before last rpmbuild update.

Also happens when you use *5.2* in mock to build the packages. And that
has an older version of rpm.

Watch and cry (I Cc: centos-devel, as I know that JBJ reads there, too).
Please do answer in centos-devel, thanks.

JBJ: 

Here's what happens: I take a src.rpm:

[angenenr at shutdown SRPMS]$rpm -qp -- at hangelog canlock-2b-3.el5.src.rpm
|head -2
* Tue May 19 2009 Ralph Angenendt <ralph at centos.org> -2b.2
- This is a test bump

I rebuild it with rpmbuild:

[angenenr at shutdown SRPMS]$rpmbuild --rebuild canlock-2b-3.el5.src.rpm
[angenenr at shutdown SRPMS]$rpm -qp --changelog
../RPMS/x86_64/canlock-2b-3.el5.x86_64.rpm |head -2
* Tue May 19 2009 Ralph Angenendt <ralph at centos.org> -2b.2
- This is a test bump

All is fine. Now let me churn it through mock.

[angenenr at shutdown SRPMS]$mock -r centos-5-x86_64 --autocache
canlock-2b-3.el5.src.rpm 
[...]
[angenenr at shutdown SRPMS]$rpm -qp --changelog
/var/lib/mock/centos-5-x86_64/result/canlock-2b-3.el5.x86_64.rpm |head
-2
* Wed May 20 2009 Ralph Angenendt <ralph at centos.org> -2b.2
- This is a test bump

Ummm?

[angenenr at shutdown SRPMS]$date
Tue May 19 13:19:25 CEST 2009

Yay! I invented a time machine! (or someone did).

Okay, let's move the machine from Germany to the UK

[angenenr at shutdown SRPMS]$sudo cp /usr/share/zoneinfo/Europe/London
/etc/localtime
[angenenr at shutdown SRPMS]$date
Tue May 19 12:20:17 BST 2009
[angenenr at shutdown SRPMS]$rpm -qp --changelog
/var/lib/mock/centos-5-x86_64/result/canlock-2b-3.el5.x86_64.rpm |head
-2
* Tue May 19 2009 Ralph Angenendt <ralph at centos.org> -2b.2
- This is a test bump

Hmmm. Who moved the international date line to the Channel?

What about mock? Let's move the machine back to Germany first.

[angenenr at shutdown SRPMS]$sudo cp /usr/share/zoneinfo/Europe/Berlin
/etc/localtime
[angenenr at shutdown SRPMS]$date
Tue May 19 13:22:08 CEST 2009
[angenenr at shutdown SRPMS]$mock -r centos-5-x86_64 shell
init
mock-chroot> date
Tue May 19 07:22:18 EDT 2009

So mock uses EDT which is 6 hours behind. Which does not explain why
moving from BST (EDT +0500) still gives me the correct date in the
changelog, moving the machine one step further to CEST (EDT +0600) moves
me to the next day, though.

What about the rpm built with rpmbuild? Let's move the machine to
Sidney:

[root at shutdown etc]# cp /usr/share/zoneinfo/Australia/Sydney localtime
[root at shutdown etc]# date
Tue May 19 21:27:50 EST 2009
[root at shutdown etc]# rpm -qp --changelog
/home/angenenr/redhat/RPMS/x86_64/canlock-2b-3.el5.x86_64.rpm 
* Tue May 19 2009 Ralph Angenendt <ralph at centos.org> -2b.2
- This is a test bump

Strange. This is 8 hours in the future (and not 6), but still shows me
the correct date.

Something is not right here. Is this something to worry about? How and
why does that happen? Why are there even calculations on the date line
in a changelog?

Cheers,

Ralph
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.centos.org/pipermail/centos/attachments/20090519/39165d89/attachment-0005.sig>