提交 9b148ca4 编写于 作者: L Luca Falavigna

Fix do_newer_version package detection

If projectb stores more than one version of a given source package,
cruft-report erroneously takes the lower one, and this sometimes leads
to wrong removals. Instruct cruft-report to take the highest version.
Signed-off-by: NLuca Falavigna <dktrkranz@debian.org>
上级 04124dca
......@@ -198,10 +198,14 @@ def do_newer_version(lowersuite_name, highersuite_name, code, session):
# Check for packages in $highersuite obsoleted by versions in $lowersuite
q = session.execute("""
WITH highersuite_maxversion AS (SELECT s.source AS source, max(s.version) AS version
FROM src_associations sa, source s
WHERE sa.suite = :highersuite_id AND sa.source = s.id group by s.source)
SELECT s.source, s.version AS lower, s2.version AS higher
FROM src_associations sa, source s, source s2, src_associations sa2
FROM src_associations sa, source s, source s2, src_associations sa2, highersuite_maxversion hm
WHERE sa.suite = :highersuite_id AND sa2.suite = :lowersuite_id AND sa.source = s.id
AND sa2.source = s2.id AND s.source = s2.source
AND hm.source = s.source AND hm.version < s2.version
AND s.version < s2.version""", {'lowersuite_id': lowersuite.suite_id,
'highersuite_id': highersuite.suite_id})
ql = q.fetchall()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册