Hi, I think it might be possible to just skip the extra sources in bin/keep-latest. I've attached a patch doing so. There's also a small test.
Ansgar
diff --git a/bin/keep-latest b/bin/keep-latest index 43cfa82..ebe87ef 100755 --- a/bin/keep-latest +++ b/bin/keep-latest @@ -55,6 +55,9 @@ for my $file (@ARGV) { if ($arch ne "source" && defined $architecture && $architecture ne "all" && $architecture ne $arch) { next; } + if ($arch eq "source" && /^Extra-Source-Only:\s*yes$/mi) { + next; + } my $key = $name; if ((!exists $version{$key}) or version_less($version{$key},$version)) {
#! /bin/bash set -e set -u input=$(tempfile) cat >>$input <<EOF Package: a Version: 0.1-1 Architecture: any Package: a Version: 0.1-2 Architecture: any Package: b Version: 0.1-1 Architecture: any Extra-Source-Only: yes Package: a Version: 0.2-1 Architecture: any Extra-Source-Only: yes EOF expected="\ Package: a Version: 0.1-2 Architecture: any" output="$(bin/keep-latest source ${input})" rm ${input} if [ "$output" != "$expected" ]; then echo "OUTPUT:" echo "-------" echo "'${output}'" echo echo "EXPECTED:" echo "---------" echo "'${expected}'" exit 1 fi