From eec67e9ae18ee4fe114807931de3c392cefe306c Mon Sep 17 00:00:00 2001 From: "Adam D. Barratt" Date: Sun, 28 Feb 2010 14:44:36 +0000 Subject: [PATCH] Only include the latest version of each source package Signed-off-by: Adam D. Barratt The Sources file for unstable will contain multiple records for a single source package when one or more architectures has out-of-date binaries. As the latest version is that which will be considered for migration, only that version should be added to the list of available sources. This is not currently an issue in live use, as the data files are already pre-processed by britney before being passed to britney2. --- britney.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/britney.py b/britney.py index d6e611f..9c968ae 100755 --- a/britney.py +++ b/britney.py @@ -406,7 +406,14 @@ class Britney: get_field = Packages.Section.get while Packages.Step(): pkg = get_field('Package') - sources[pkg] = [get_field('Version'), + ver = get_field('Version') + # There may be multiple versions of the source package + # (in unstable) if some architectures have out-of-date + # binaries. We only ever consider the source with the + # largest version for migration. + if pkg in sources and apt_pkg.VersionCompare(sources[pkg][0], ver) > 0: + continue + sources[pkg] = [ver, get_field('Section'), [], get_field('Maintainer'),