aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xmodules/buildsystem/templates/cleaner.rb17
1 files changed, 15 insertions, 2 deletions
diff --git a/modules/buildsystem/templates/cleaner.rb b/modules/buildsystem/templates/cleaner.rb
index 97b91ab0..88195e15 100755
--- a/modules/buildsystem/templates/cleaner.rb
+++ b/modules/buildsystem/templates/cleaner.rb
@@ -65,6 +65,7 @@ def process
src_path = "#{base_path}/#{version}/SRPMS/#{media}"
$used_srcs = {}
+ $old_srcs = {}
$srcs = {}
$srcages = {}
$noarch = {}
@@ -76,7 +77,19 @@ def process
buildtime = l2[1].to_i
buildarch = l2[2].rstrip
name = name_from_filename(filename)
- $srcages[name] = [ filename, buildtime ] unless $srcages[name] && buildtime < $srcages[name][1]
+ if $srcages[name] then
+ if buildtime < $srcages[name][1] then
+ # This src.rpm is older, ignore it and store it in the list to be deleted
+ $old_srcs[filename] = true
+ next
+ else
+ # This src.rpm has an older version, ignore that version and store it in the list to be deleted
+ old_filename = $srcages[name][0]
+ $old_srcs[old_filename] = true
+ $srcs.delete(old_filename)
+ end
+ end
+ $srcages[name] = [ filename, buildtime ]
$srcs[filename] = true
$noarch[name] = true if buildarch == 'noarch'
}
@@ -90,7 +103,7 @@ def process
}
$used_srcs.keys.each{|s| $srcs.delete(s)}
- move_packages(src_path, old_path, $srcs.keys, auto)
+ move_packages(src_path, old_path, $srcs.keys + $old_srcs.keys, auto)
}
end