RPM Community Forums

Mailing List Message of <rpm-devel>

Re: [CVS] RPM: rpm/ CHANGES rpm/lib/ depends.c

From: Jeff Johnson <n3npq@mac.com>
Date: Thu 31 Jan 2008 - 17:46:15 CET
Message-Id: <49DA0F37-4EFD-44EA-92CE-950D01CA3011@mac.com>

On Jan 31, 2008, at 11:36 AM, Ralf S. Engelschall wrote:

> On Thu, Jan 31, 2008, Jeff Johnson wrote:
>
>>     - jbj: fix: retrieve originTime from old, not new, header.
>> [...]
>>       /* Snarf the original install time from older package(s). */
>>       he->tag = RPMTAG_ORIGINTIME;
>>   -   xx = headerGet(h, he, 0);
>>   +   xx = headerGet(oh, he, 0);
>>       if (xx && he->p.ui32p != NULL) {
>>           if (p->originTime == 0 || p->originTime > he->p.ui32p[0])
>>           p->originTime = he->p.ui32p[0];
>
> Thanks for your efforts, Jeff.
>
> Unfortunately, it think there is still a bug somewhere:
>

Possible ;-)

Here's what I see:
$ sh -x t
+ sudo rpm -e time --nodeps
+ sudo rpm -Uvh time-1.7-27.i386.rpm
warning: time-1.7-27.i386.rpm: Header V3 DSA signature: NOKEY, key ID  
4f2a6fd2
Preparing...                 
########################################### [100%]
    1:time                    
########################################### [100%]
+ rpm -q --qf '%{origintime:date}\n' time
Thu 31 Jan 2008 11:44:33 AM EST
+ sleep 10
+ sudo rpm -Uvh time-1.7-30.i386.rpm
Preparing...                 
########################################### [100%]
Repackaging...
    1:time                    
########################################### [100%]
Upgrading...
    1:time                    
########################################### [100%]
+ rpm -q --qf '%{origintime:date}\n' time
Thu 31 Jan 2008 11:44:33 AM EST

> 1. After(!) upgrading the RPM program itself:
>
> | $ /openpkg/bin/openpkg rpm -q openpkg --qf '%{ORIGINTIME:date}\n% 
> {INSTALLTIME:date}\n'
> | Thu Jan 31 17:19:59 2008
> | Thu Jan 31 17:19:59 2008
> | $ /openpkg/bin/openpkg rpm -Uvh --force ../pkg/ 
> openpkg-4.0a0-20080131.ix86-freebsd6.3-openpkg.rpm
> | Preparing...                 
> ########################################### [100%]
> |    1:openpkg                 
> ########################################### [100%]
> | $ /openpkg/bin/openpkg rpm -q openpkg --qf '%{ORIGINTIME:date}\n% 
> {INSTALLTIME:date}\n'
> | Thu Jan 31 17:20:44 2008
> | Thu Jan 31 17:20:44 2008
>
> 2. After updating (rebuild+reinstall) the RPM program once again:
>
> | $ /openpkg/bin/openpkg rpm -q openpkg --qf '%{ORIGINTIME:date}\n% 
> {INSTALLTIME:date}\n'
> | Thu Jan 31 17:20:44 2008
> | Thu Jan 31 17:28:18 2008
>              ^^^^^^^^ here it at least once worked surprisingly!
> | $ sudo /openpkg/bin/openpkg rpm -Uvh --force ../pkg/ 
> openpkg-4.0a0-20080131.ix86-freebsd6.3-openpkg.rpm
> | Preparing...                 
> ########################################### [100%]
> |    1:openpkg                 
> ########################################### [100%]
> | $ /openpkg/bin/openpkg rpm -q openpkg --qf '%{ORIGINTIME:date}\n% 
> {INSTALLTIME:date}\n'
> | Thu Jan 31 17:28:41 2008
> | Thu Jan 31 17:28:41 2008
>
> And all this is really with your bugfix already applied and with RPM
> already upgraded to this version, of course:
>
> | $ /openpkg/bin/openpkg rpm --version
> | rpm (OpenPKG RPM) 5.1.SNAPSHOT.20080131
> | $ gunzip <~/prj/openpkg-2008/src/openpkg/dst/rpm-5.1.SNAPSHOT. 
> 20080131.tar.gz | tar xf -
> | $ grep -C3 RPMTAG_ORIGINTIME rpm-5.1.SNAPSHOT.20080131/lib/depends.c
> |         xx = rpmteChain(p, q, oh, "Upgrades");
> |
> |         /* Snarf the original install time from older package(s). */
> |         he->tag = RPMTAG_ORIGINTIME;
> |         xx = headerGet(oh, he, 0);
> |         if (xx && he->p.ui32p != NULL) {
> |             if (p->originTime == 0 || p->originTime > he->p.ui32p 
> [0])
>
> Very strange... I see no deterministic pattern here. It more or less
> never works except for the single attempt in the middle of my  
> tests. I'm
> puzzled...

Note that the lookup is by RPMTAG_PROVIDENAME, not RPMTAG_NAME,
and that the oldest originTime is used.

73 de Jeff
Received on Thu Jan 31 17:46:59 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.