#349: Depcheck - prefilter the list of packages passed to yum instance's rpmdb
----------------------+-----------------------------------------------------
Reporter: jskladan | Owner:
Type: task | Status: new
Priority: major | Milestone: 0.6.0
Component: core | Resolution:
Keywords: |
----------------------+-----------------------------------------------------
Old description:
Recent problem with libreport
<
http://autoqa.fedoraproject.org/results/140482-autotest/172.16.0.20/depch...
is most probably caused by depcheck selecting too old packages (i.e.
ignoring the newest packages in repos) due to the fact that YUM selects
packages alphabeticaly on fist-comes-first served basis.
Because YUM is hacked into believing that all packages are installed by
passing the content of _whole_ pkgsack into the rpmdb, it contains
multiple versions of the same package.
I belive, that this can be easily solved by pre-filtering the list, so it
contains only the newest from each package.
<code>
# This YumBase object will act like all repo packages are already
installed
y = YumDepcheck()
y.tsInfo = yum.transactioninfo.TransactionData()
y.tsInfo.debug = 1
# this line is causing the problems
y.rpmdb = MetaSackRPMDB(yum_repos.pkgSack)
y.xsack = yum.packageSack.PackageSack()
# Hacky way to set up the databases (this is copied from yum's
testbase.py)
y.tsInfo.setDatabases(y.rpmdb, y.xsack)
</code>
the yum_repos.pkgSack is a list of tuples NAEVR <code>[('libreport',
'x86_64', '0', '2.0.2', '5.fc15'), ('libreport',
'i686', '0', '2.0.2',
'5.fc15'), ('libreport', 'x86_64', '0', '2.0.4',
'1.fc15'), ('libreport',
'i686', '0', '2.0.4', '1.fc15')]</code>
After the filtering, only the newest package for each architecture should
be left. Newest = the first while sorting using E,V,R as keys with
decreasing importance in this order. I.e. <code> [('libreport',
'x86_64',
'0', '2.0.4', '1.fc15'), ('libreport', 'i686',
'0', '2.0.4',
'1.fc15')]</code>. koji_utils.compareEVR() can be used to compare EVRs.
New description:
Recent problem with libreport
<
http://autoqa.fedoraproject.org/results/140482-autotest/172.16.0.20/depch...
is most probably caused by depcheck selecting too old packages (i.e.
ignoring the newest packages in repos) due to the fact that YUM selects
packages alphabeticaly on fist-comes-first served basis.
Because YUM is hacked into believing that all packages are installed by
passing the content of _whole_ pkgsack into the rpmdb, it contains
multiple versions of the same package.
I belive, that this can be easily solved by pre-filtering the list, so it
contains only the newest from each package.
{{{
# This YumBase object will act like all repo packages are already
installed
y = YumDepcheck()
y.tsInfo = yum.transactioninfo.TransactionData()
y.tsInfo.debug = 1
# this line is causing the problems
y.rpmdb = MetaSackRPMDB(yum_repos.pkgSack)
y.xsack = yum.packageSack.PackageSack()
# Hacky way to set up the databases (this is copied from yum's
testbase.py)
y.tsInfo.setDatabases(y.rpmdb, y.xsack)
}}}
the yum_repos.pkgSack is a list of tuples NAEVR
{{{
[('libreport', 'x86_64', '0', '2.0.2', '5.fc15'),
('libreport', 'i686',
'0', '2.0.2', '5.fc15'), ('libreport', 'x86_64',
'0', '2.0.4', '1.fc15'),
('libreport', 'i686', '0', '2.0.4', '1.fc15')]
}}}
After the filtering, only the newest package for each architecture should
be left. Newest = the first while sorting using E,V,R as keys with
decreasing importance in this order. I.e.
{{{
[('libreport', 'x86_64', '0', '2.0.4', '1.fc15'),
('libreport', 'i686',
'0', '2.0.4', '1.fc15')]
}}}
koji_utils.compareEVR() can be used to compare EVRs.
--
Ticket URL: <
https://fedorahosted.org/autoqa/ticket/349#comment:1>
AutoQA <
http://autoqa.fedorahosted.org>
Automated QA project