Re: --allow-downgrade - how does it work? still having problems...

Troy Dawson <[email protected]>
Newsgroups gmane.linux.rpm.yum
Message-ID <[email protected]>
Seth Vidal wrote:
> On Thu, 2008-09-18 at 22:55 +0200, Nikola Ciprich wrote:
>> Hello everybody,
>> some time ago, I asked here for help, because I can't get allowdowngrade plugin
>> working. We didn't come to any conclusion, and I didn't have time to play with
>> it anymore, but now I got back to it, and I'd like to ask for bit of explanation.
>> I did a bit of exploring, and I'm a bit confused. It seems that allowdowngrade adds
>> hooks to postresolve, but if I try to install package, yum just doesn't get there
>> at all, so plugin can't really change anything.
>> It seems that it ends in yum/__init__.py, after line 2392 (install method):
>>
>>             # make sure we don't have a name.arch of this already installed
>>             # if so pass it to update b/c it should be able to figure it out
>>             if self.rpmdb.contains(name=po.name, arch=po.arch) and not self.allowedMultipleInstalls(po):
>>                 if not self.tsInfo.getMembersWithState(po.pkgtup, TS_REMOVE_STATES):
>>                     self.verbose_logger.warning(_('Package matching %s already installed. Checking for update.')
>>                     txmbrs = self.update(po=po)
>>                     tx_return.extend(txmbrs)
>>                     continue
>>
>> self.update(po=po) returns empty list, which causes package to be skipped. Is this intended behaviour?
>> Should I be looking elsewhere?
>> I'm using latest yum and yum-allowdowngrade
>> Any ideas?
>> thanks a lot in advance!
>> with best regards
> 
> Nope, I think you're on the right path. Making sure allowdowngrade
> semi-behaves is on my list to fix before 3.2.20 comes out.
> 
> If you can fix it w/o breaking more things please send a patch you may
> have.
> 
> -sv
> 

Hi All,
I'm looking back and it looks like I never got back with the syntax of 
allow-downgrade.

I don't know about 3.2.20, but in 3.2.8 it is working, but the syntax is a 
little different than expected.

Make sure you have the allowdowngrade plugin installed. Also make sure that the 
downgraded rpm is in your yum repository.
The syntax is

yum --allow-downgrade install <rpm name in special format>

The special format is gotten by doing
rpm -qp --qf "%|epoch?{%{epoch}}:{0}|:%{name}-%{version}-%{release}.%{arch}\n" 
<rpm>

So a package like firefox-3.0-0.beta5.6.el5.i386.rpm comes out like 
0:firefox-3.0-0.beta5.6.el5.i386

Troy
p.s. I'm about ready to post of plugin called versionfix which was originally 
based on allow-downgrade, which is why I saw this.
-- 
__________________________________________________
Troy Dawson  [email protected]  (630)840-6468
Fermilab  ComputingDivision/LCSI/CSI DSS Group
__________________________________________________
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.