[Yum-devel] [PATCH] Handle avail_po.returnPrco('strong_requires') in RpmBase.
James Antill
james at fedoraproject.org
Tue May 15 15:55:41 UTC 2012
On Tue, 2012-05-15 at 10:58 -0400, Zdenek Pavlas wrote:
> > NAK. This will give 0 strong_requires for all available packages.
>
> I see. Thought strong_requires are "additional" requires that
> only RPM knows about, but it's a subset of requires actually.
Yeh, it's the requires that we can't remove post install.
> > 1. Get the RPMTAG_REQUIREFLAGS bits into createrepo data, and then
> > act on them. This means we'll be giving correct data out, although I'm
> > not sure how useful that is ... and doing all this will be annoyingly
> > hard (have to change all the repo. metadata ... lol).
>
> AIUI, Yum does not need requireflags when installing packages,
> and in all other cases we can just ask RPM. So it's really
> not of much use anyway.
Right, but the QA code is pretending that an available package is
installed ... so to be _correct_ we should do what we'd do if the
package was actually installed.
But, annoyingly hard.
> > 2. Just make strong_requires == requires, this is kind of hacky ...
> > but at least is on the right side of failure (and could be argued to be
> > correct anyway, as all the requires are strong ... until the package
> > is installed).
>
> I think that would be ok, too.
Yeh, probably should add a comment so it's not as confusing for the
next person (esp. as 99.999% of code paths should never get there). But
ACK.
> diff --git a/yum/sqlitesack.py b/yum/sqlitesack.py
> index f6df93e..41ed124 100644
> --- a/yum/sqlitesack.py
> +++ b/yum/sqlitesack.py
> @@ -382,6 +382,8 @@ class YumAvailablePackageSqlite(YumAvailablePackage, PackageObject, RpmBase):
>
> def returnPrco(self, prcotype, printable=False):
> + if prcotype == 'strong_requires':
> + prcotype = 'requires'
> prcotype = _share_data(prcotype)
> if isinstance(self.prco[prcotype], tuple):
> sql = "SELECT name, version, release, epoch, flags " \
> "FROM %s WHERE pkgKey = ?" % prcotype
More information about the Yum-devel
mailing list