[Yum-devel] [PATCH 1/2] make sure obsoletes are looked up for localinstall/updated pkgs this handles the cases where the localpkg is a proper update AND an obsolete for a different installed pkg.

Seth Vidal skvidal at fedoraproject.org
Wed Aug 12 13:21:04 UTC 2009



On Tue, 11 Aug 2009, James Antill wrote:

>> -            if po.pkgtup == obstup:
>> -                installed_pkg =  self.rpmdb.searchPkgTuple(inst_tup)[0]
>> -                yield installed_pkg
>> +        if not isinstance(po, YumLocalPackage):
>> +            for (obstup, inst_tup) in self.up.getObsoletersTuples(name=po.name):
>> +                if po.pkgtup == obstup:
>> +                    installed_pkg =  self.rpmdb.searchPkgTuple(inst_tup)[0]
>> +                    yield installed_pkg
>> +        else:
>> +            for (obs_n, obs_f, (obs_e, obs_v, obs_r)) in po.obsoletes:
>> +                for pkg in self.rpmdb.searchNevra(name=obs_n):
>> +                    installedtup = (pkg.name, 'EQ', (pkg.epoch,
>> +                                   pkg.ver, pkg.release))
>> +                    if po.inPrcoRange('obsoletes', installedtup):
>> +                        yield pkg
>
>
> I agree this "works", however the problem is that we rely on the
> obsoletes data which is built up before we do anything based on looking
> at just what is in the repos. So if we have local pkgs:
>
> pkg-new-A
> pkgA
>
> ...and pkg-new-A obs pkgA, then doing either of:
>
> yum install pkgA.rpm pkg-new-A.rpm
> yum install pkg-new-A.rpm pkgA.rpm
>
> ...I think we screw it up.
> At worst I think we need a big comment in here, one better would be to
> check txmbr's as well as rpmdb.searchNevra() ... or the best case we
> could add the obsoletes data to self.up as we load the LocalPackage().
> Of course no user is ever going to do any of the above commands,
> hahaha, so it's nitpicky.
>


But installing pkg-A and pkg-new-A can be completely consistent and not 
conflicting at all. Especially from local pkgs.

A comment is fine but I'm not going to chase down a bunch of rabbit holes 
unless we have a case where this is unhappy.


>> +
>> +        for txmbr in tx_return:
>> +            if txmbr.po.obsoletes:
>> +                for obs_pkg in self._find_obsoletees(txmbr.po):
>> +                    self.tsInfo.addObsoleted(obs_pkg, txmbr.po)
>> +                    txmbr.obsoletes.append(obs_pkg)
>> +                    self.tsInfo.addObsoleting(txmbr.po,obs_pkg)
>> +
>>          return tx_return
>
> This is the bottom of installLocal(), and I assume it works ... but did
> you try doing what reinstallLocal() does ... ie. end with
> self.install(po=po) as I think that will also fix this.
> The later seems better to me, but I wouldn't bet houses on it.

the pkg has already been self.install()'d or self.update()'d earlier in 
installLocal(). This is just tagging the items as obsoleting pkgs, too.

-sv





More information about the Yum-devel mailing list