List<DerbyDistribution> distributions) {
// Sort the releases based on the version number (highest first).
Collections.sort(distributions);
Collections.reverse(distributions);
DerbyDistribution prev = null;
if (newestFixpackOnly) {
List<DerbyDistribution> filtered =
new ArrayList<DerbyDistribution>();
for (DerbyDistribution d : distributions) {
DerbyVersion ver = d.getVersion();
if (prev == null || prev.getVersion().greaterMinorThan(ver)) {
filtered.add(d);
} else {
println("ignored " + ver.toString() +
", not the newest fixpack version for " +
ver.getMajor() + "." + ver.getMinor());